[GTK] Use CROSS_PLATFORM_CONTEXT_MENUS
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Nov 2015 16:08:32 +0000 (16:08 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Nov 2015 16:08:32 +0000 (16:08 +0000)
commitb7f2ea2074fe1e89ff95d38411b7553ac9e838c6
treef5d9733c7cf62196040766b9bc12e7a15385a177
parent6e5fa4e45fb18b64b982963482adeac4bfae50fc
[GTK] Use CROSS_PLATFORM_CONTEXT_MENUS
https://bugs.webkit.org/show_bug.cgi?id=150642

Reviewed by Martin Robinson.

Source/WebCore:

Remove GTK+ implementations of old context menu classes.

* PlatformGTK.cmake:
* platform/ContextMenuItem.h:
* platform/gtk/ContextMenuGtk.cpp: Removed.
* platform/gtk/ContextMenuItemGtk.cpp: Removed.

Source/WebKit2:

Use CROSS_PLATFORM_CONTEXT_MENUS. Since we can't just use
WebContextMenuItemData, because we need to bind a GtkAction to the
menu items, this patch adds WebContextMenuItemGtk that derives
from WebContextMenuItemData and adds the GtkAction and its own
handling of submenu items. WebKitContextMenu and
WebKitContextMenuItem no longer deal with the widgets (GtkMenu and
GtkMenuItem), that are now created by WebContextMenuProxy when
building the popup menu.
This patch also removes the support for input methods submenu,
since it has been deprecated (and disabled by default) in GTK+ for
long time, it has never actually worked (because the menu items
don't have a GtkAction associated) and it makes the code more
complicated for no benefit.

* PlatformGTK.cmake:
* Shared/gtk/WebContextMenuItemGtk.cpp: Added.
(WebKit::gtkStockIDFromContextMenuAction):
(WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk):
(WebKit::WebContextMenuItemGtk::~WebContextMenuItemGtk):
(WebKit::WebContextMenuItemGtk::createGtkActionIfNeeded):
* Shared/gtk/WebContextMenuItemGtk.h: Copied from Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h.
(WebKit::WebContextMenuItemGtk::gtkAction):
(WebKit::WebContextMenuItemGtk::submenuItems):
* UIProcess/API/gtk/WebKitContextMenu.cpp:
(webkitContextMenuPopulate):
(webkitContextMenuCreate): Deleted.
(webkitContextMenuSetParentItem): Deleted.
* UIProcess/API/gtk/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetForContextMenuItem):
* UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
(webkitContextMenuItemSetSubMenu):
(webkitContextMenuItemCreate):
(webkitContextMenuItemToWebContextMenuItemGtk):
(webkitContextMenuItemToWebContextMenuItemData):
(webkit_context_menu_item_new):
(webkit_context_menu_item_new_from_stock_action):
(webkit_context_menu_item_new_from_stock_action_with_label):
(webkit_context_menu_item_new_with_submenu):
(webkit_context_menu_item_new_separator):
(webkit_context_menu_item_get_action):
(webkit_context_menu_item_get_stock_action):
(webkit_context_menu_item_is_separator): Deleted.
* UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewPopulateContextMenu):
(contextMenuDismissed): Deleted.
(webkitWebViewSubmitFormRequest): Deleted.
(webkitWebViewHandleAuthenticationChallenge): Deleted.
(webkitWebViewInsecureContentDetected): Deleted.
(webkitWebViewEmitRunColorChooser): Deleted.
(webkitWebViewRequestInstallMissingMediaPlugins): Deleted.
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::contextMenuItemActivatedCallback):
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::populate):
(WebKit::WebContextMenuProxyGtk::show):
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
* UIProcess/gtk/WebContextMenuProxyGtk.h:
(WebKit::WebContextMenuProxyGtk::gtkMenu):
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:

Source/WTF:

Enable CROSS_PLATFORM_CONTEXT_MENUS for GTK+ port.

* wtf/Platform.h:

Tools:

Remove test for input methods submenu.

* TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/gtk/ContextMenuGtk.cpp [deleted file]
Source/WebCore/platform/gtk/ContextMenuItemGtk.cpp [deleted file]
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp [new file with mode: 0644]
Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestContextMenu.cpp