Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
<rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=…
…48699 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: Canonical link: https://commits.webkit.org/61539@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
with
1,142 additions
and 6 deletions.
- +33 −0 WebCore/ChangeLog
- +13 −0 WebCore/WebCore.exp.in
- +1 −0 WebCore/WebCore.xcodeproj/project.pbxproj
- +4 −0 WebCore/loader/EmptyClients.h
- +7 −0 WebCore/page/Chrome.cpp
- +4 −0 WebCore/page/Chrome.h
- +4 −0 WebCore/page/ChromeClient.h
- +2 −0 WebCore/platform/ContextMenu.h
- +5 −0 WebCore/platform/mac/ContextMenuItemMac.mm
- +13 −0 WebCore/platform/mac/ContextMenuMac.mm
- +6 −0 WebCore/platform/qt/ContextMenuItemQt.cpp
- +5 −0 WebCore/platform/qt/ContextMenuQt.cpp
- +6 −0 WebCore/platform/win/ContextMenuItemWin.cpp
- +6 −0 WebCore/platform/win/ContextMenuWin.cpp
- +10 −0 WebKit/chromium/ChangeLog
- +4 −0 WebKit/chromium/src/ChromeClientImpl.h
- +10 −0 WebKit/efl/ChangeLog
- +4 −0 WebKit/efl/WebCoreSupport/ChromeClientEfl.h
- +10 −0 WebKit/gtk/ChangeLog
- +3 −0 WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
- +10 −0 WebKit/haiku/ChangeLog
- +3 −0 WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
- +10 −0 WebKit/mac/ChangeLog
- +3 −0 WebKit/mac/WebCoreSupport/WebChromeClient.h
- +10 −0 WebKit/qt/ChangeLog
- +3 −0 WebKit/qt/WebCoreSupport/ChromeClientQt.h
- +10 −0 WebKit/win/ChangeLog
- +4 −0 WebKit/win/WebCoreSupport/WebChromeClient.h
- +10 −0 WebKit/wx/ChangeLog
- +4 −0 WebKit/wx/WebKitSupport/ChromeClientWx.h
- +81 −0 WebKit2/ChangeLog
- +123 −0 WebKit2/Shared/WebContextMenuItem.cpp
- +73 −0 WebKit2/Shared/WebContextMenuItem.h
- +1 −0 WebKit2/UIProcess/API/mac/PageClientImpl.h
- +6 −0 WebKit2/UIProcess/API/mac/PageClientImpl.mm
- +7 −0 WebKit2/UIProcess/API/qt/qwkpage.cpp
- +1 −0 WebKit2/UIProcess/API/qt/qwkpage_p.h
- +3 −1 WebKit2/UIProcess/PageClient.h
- +37 −0 WebKit2/UIProcess/WebContextMenuProxy.cpp
- +54 −0 WebKit2/UIProcess/WebContextMenuProxy.h
- +16 −0 WebKit2/UIProcess/WebPageProxy.cpp
- +8 −0 WebKit2/UIProcess/WebPageProxy.h
- +3 −0 WebKit2/UIProcess/WebPageProxy.messages.in
- +69 −0 WebKit2/UIProcess/mac/WebContextMenuProxyMac.h
- +194 −0 WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm
- +6 −0 WebKit2/UIProcess/win/WebView.cpp
- +1 −0 WebKit2/UIProcess/win/WebView.h
- +6 −0 WebKit2/WebKit2.pro
- +33 −1 WebKit2/WebKit2.xcodeproj/project.pbxproj
- +8 −0 WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
- +4 −0 WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
- +8 −3 WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
- +62 −0 WebKit2/WebProcess/WebPage/WebContextMenu.cpp
- +53 −0 WebKit2/WebProcess/WebPage/WebContextMenu.h
- +31 −1 WebKit2/WebProcess/WebPage/WebPage.cpp
- +10 −0 WebKit2/WebProcess/WebPage/WebPage.h
- +3 −0 WebKit2/WebProcess/WebPage/WebPage.messages.in
- +24 −0 WebKit2/win/WebKit2.vcproj
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -91,6 +91,8 @@ namespace WebCore { | ||
#endif | ||
}; | ||
|
||
Vector<ContextMenuItem> contextMenuItemVector(PlatformMenuDescription); | ||
|
||
} | ||
|
||
#endif // ContextMenu_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.