-
rdar://problem/7660547https://bugs.webkit.org/show_bug.cgi?id=48699beidson@apple.com authored
Context menu support for WebKit 2. Reviewed by Anders Carlsson. WebCore: Add a "showContextMenu" call to Chrome/ChromeClient: * loader/EmptyClients.h: (WebCore::EmptyChromeClient::showContextMenu): * page/Chrome.cpp: (WebCore::Chrome::showContextMenu): * page/Chrome.h: * page/ChromeClient.h: Add a "platform description to ContextMenuItem" creator, will be needed by WebKit2 * platform/ContextMenu.h: * platform/mac/ContextMenuMac.mm: (WebCore::contextMenuItemVector): * platform/mac/ContextMenuItemMac.mm: (WebCore::ContextMenuItem::checked): WebKit2 ports now need this implemented. Stub these out to keep their WK2 ports building: * platform/qt/ContextMenuItemQt.cpp: (WebCore::ContextMenuItem::checked): * platform/qt/ContextMenuQt.cpp: (WebCore::contextMenuItemVector): * platform/win/ContextMenuItemWin.cpp: (WebCore::ContextMenuItem::checked): * platform/win/ContextMenuWin.cpp: (WebCore::contextMenuItemVector): WebKit/chromium: * src/ChromeClientImpl.h: (WebKit::ChromeClientImpl::showContextMenu): WebKit/efl: * WebCoreSupport/ChromeClientEfl.h: (WebCore::ChromeClientEfl::showContextMenu): WebKit/gtk: * WebCoreSupport/ChromeClientGtk.h: (WebKit::ChromeClient::showContextMenu): WebKit/haiku: * WebCoreSupport/ChromeClientHaiku.h: (WebCore::ChromeClientHaiku::showContextMenu): WebKit/mac: * WebCoreSupport/WebChromeClient.h: (WebChromeClient::showContextMenu): WebKit/qt: * WebCoreSupport/ChromeClientQt.h: (WebCore::ChromeClientQt::showContextMenu): WebKit/win: * WebCoreSupport/WebChromeClient.h: (WebChromeClient::showContextMenu): WebKit/wx: * WebKitSupport/ChromeClientWx.h: (WebCore::ChromeClientWx::showContextMenu): WebKit2: * WebKit2.pro: * WebKit2.xcodeproj/project.pbxproj: * win/WebKit2.vcproj: * Shared/WebContextMenuItem.cpp: Added. (WebKit::WebContextMenuItem::WebContextMenuItem): (WebKit::WebContextMenuItem::encode): (WebKit::WebContextMenuItem::decode): (WebKit::kitItems): * Shared/WebContextMenuItem.h: Added. * UIProcess/API/mac/PageClientImpl.h: * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::createContextMenuProxy): * UIProcess/API/qt/qwkpage.cpp: (QWKPagePrivate::createContextMenuProxy): Stub to keep the build working. * UIProcess/API/qt/qwkpage_p.h: * UIProcess/PageClient.h: * UIProcess/WebContextMenuProxy.cpp: Added. (WebKit::WebContextMenuProxy::~WebContextMenuProxy): (WebKit::WebContextMenuProxy::WebContextMenuProxy): * UIProcess/WebContextMenuProxy.h: Added. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::showContextMenu): Shows the menu after receiving the message from the WebProcess. (WebKit::WebPageProxy::contextMenuItemSelected): Sends info about the selected menu item to the WebProcess * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WebContextMenuProxyMac.h: Added. (WebKit::WebContextMenuProxyMac::create): * UIProcess/mac/WebContextMenuProxyMac.mm: Added. (+[WebMenuTarget sharedMenuTarget]): (-[WebMenuTarget WebKit::]): (-[WebMenuTarget setMenuProxy:WebKit::]): (-[WebMenuTarget forwardContextMenuAction:]): (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac): (WebKit::WebContextMenuProxyMac::~WebContextMenuProxyMac): (WebKit::WebContextMenuProxyMac::contextMenuItemSelected): (WebKit::populateNSMenu): (WebKit::nsMenuItemVector): (WebKit::WebContextMenuProxyMac::populate): (WebKit::WebContextMenuProxyMac::showContextMenu): (WebKit::WebContextMenuProxyMac::hideContextMenu): * UIProcess/win/WebView.cpp: (WebKit::WebView::createContextMenuProxy): Stub for now. * UIProcess/win/WebView.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::showContextMenu): * WebProcess/WebCoreSupport/WebChromeClient.h: * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::getCustomMenuFromDefaultItems): Return the WebCore-provided default menu for now. Embedding app customization will come later (see bug 48720) * WebProcess/WebPage/WebContextMenu.cpp: Added. (WebKit::WebContextMenu::WebContextMenu): (WebKit::WebContextMenu::~WebContextMenu): (WebKit::WebContextMenu::show): (WebKit::WebContextMenu::itemSelected): * WebProcess/WebPage/WebContextMenu.h: Added. (WebKit::WebContextMenu::create): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::contextMenu): (WebKit::handleMouseEvent): Pass right mouse presses along to WebCore as both a mouse event and context menu event, the same way WebKit1 does. (WebKit::WebPage::didSelectItemFromActiveContextMenu): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/WebPage.messages.in: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
3a0329aa