2011-06-13 Carlos Garcia Campos <cgarcia@igalia.com>
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jun 2011 09:35:30 +0000 (09:35 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jun 2011 09:35:30 +0000 (09:35 +0000)
commit34646a3d63160f554331c3aaa65b1ac742261f75
treefc32d25e5674d87b654c5e9f3e7e7df01288a61d
parent7ac5d8f2228cc0120f9156cd6e4fcccbed2bdaed
2011-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        Reviewed by Martin Robinson.

        [GTK] Add context menu support for Webkit2
        https://bugs.webkit.org/show_bug.cgi?id=54827

        * platform/ContextMenuItem.h: Add gtkAction().
        * platform/gtk/ContextMenuGtk.cpp:
        (WebCore::ContextMenu::ContextMenu): Implement constructor that
        receives a platform menu.
        (WebCore::ContextMenu::setPlatformDescription): Make sure we don't
        destroy the menu if the new context menu is the current one.
        (WebCore::contextMenuItemVector): Implement this method to return
        the list of menu items in the given context menu, required by WebKit2.
        (WebCore::platformMenuDescription): Implement this method to
        return a platform menu for the given menu items.
        * platform/gtk/ContextMenuItemGtk.cpp:
        (WebCore::createPlatformMenuItemDescription): Helper function to
        create a platform context menu item.
        (WebCore::ContextMenuItem::ContextMenuItem): Use
        createPlatformMenuItemDescription().
        (WebCore::ContextMenuItem::title): Convert the title from UTF-8.
        (WebCore::ContextMenuItem::setTitle): Use gtkAction().
        (WebCore::ContextMenuItem::setSubMenu): Implement setSubMenu()
        that receives a list of items.
        (WebCore::ContextMenuItem::setChecked): Use gtkAction().
        (WebCore::ContextMenuItem::checked): Implement this, required by WebKit2.
        (WebCore::ContextMenuItem::enabled): Ditto.
        (WebCore::ContextMenuItem::setEnabled): Use gtkAction().
        (WebCore::ContextMenuItem::gtkAction): Return the GtkAction
        associated to the context menu item.
2011-06-13  Carlos Garcia Campos  <cgarcia@igalia.com>

        Reviewed by Martin Robinson.

        [GTK] Add context menu support for Webkit2
        https://bugs.webkit.org/show_bug.cgi?id=54827

        * GNUmakefile.am: Add new files to compilation.
        * UIProcess/API/gtk/PageClientImpl.cpp:
        (WebKit::PageClientImpl::createContextMenuProxy): Create a context
        menu proxy.
        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (globalPointForClientPoint): Function copied from webkit1 to
        convert a point in widget coordinates to global coordinates.
        (popupMenuPositionFunction):
        (webkitWebViewBaseShowContextMenu): Show the given context menu at
        the given position.
        * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
        * UIProcess/gtk/WebContextMenuProxyGtk.cpp: Added.
        (WebKit::contextMenuItemActivatedCallback):
        (WebKit::WebContextMenuProxyGtk::createGtkMenu):
        (WebKit::WebContextMenuProxyGtk::showContextMenu):
        (WebKit::WebContextMenuProxyGtk::hideContextMenu):
        (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
        (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
        * UIProcess/gtk/WebContextMenuProxyGtk.h: Copied from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h.
        (WebKit::WebContextMenuProxyGtk::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/gtk/ContextMenuGtk.cpp
Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h [new file with mode: 0644]