Merge sync and async code paths for getting context menus
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jan 2018 21:58:34 +0000 (21:58 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Jan 2018 21:58:34 +0000 (21:58 +0000)
commitd24cee10138df25430e22f081bf4a310e1b3459e
tree70965a6327e7648984947fbf28276a18d7372a00
parent3d7e29ece2f9c05b2a4b7d94cbe0b4ea2c7ae27f
Merge sync and async code paths for getting context menus
https://bugs.webkit.org/show_bug.cgi?id=181423

Reviewed by Joseph Pecoraro.

What a mess.  We had a code path for asynchronous context menu generation and a different one for synchronous context menu generation.
This makes it so there is just one.  At the API level we see if there is an asynchronous delegate to call, then synchronous.
There is a subtle theoretical change in behaviour because m_page.contextMenuClient().showContextMenu is now called for the asynchronous
case and it wasn't before, but the one C API client that uses this has nullptr as it's WKPageShowContextMenuCallback, so we won't break anything!

* UIProcess/API/APIContextMenuClient.h:
(API::ContextMenuClient::getContextMenuFromProposedMenu):
(API::ContextMenuClient::getContextMenuFromProposedMenuAsync): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageContextMenuClient):
* UIProcess/API/glib/WebKitContextMenuClient.cpp:
* UIProcess/WebContextMenuProxy.h:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::show):
(WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
* UIProcess/gtk/WebContextMenuProxyGtk.h:
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
(WebKit::WebContextMenuProxyMac::showContextMenu):
* UIProcess/wpe/WebContextMenuProxyWPE.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/PlatformMac.cmake
Source/WebKit/UIProcess/API/APIContextMenuClient.h
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/glib/WebKitContextMenuClient.cpp
Source/WebKit/UIProcess/WebContextMenuProxy.h
Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.cpp
Source/WebKit/UIProcess/gtk/WebContextMenuProxyGtk.h
Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.h
Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
Source/WebKit/UIProcess/wpe/WebContextMenuProxyWPE.h