-
rdar://problem/8613727https://bugs.webkit.org/show_bug.cgi?id=48720beidson@apple.com authored
Customizable context menu support in WebKit2. Reviewed by Darin Adler. Various WebCore support to allow WebKit2 to create new ContextMenuItems with the information it has. * WebCore.exp.in: * platform/ContextMenu.h: * platform/ContextMenuItem.h: * platform/mac/ContextMenuItemMac.mm: (WebCore::ContextMenuItem::ContextMenuItem): (WebCore::ContextMenuItem::setSubMenu): * platform/mac/ContextMenuMac.mm: (WebCore::platformMenuDescription): * platform/qt/ContextMenuItemQt.cpp: (WebCore::ContextMenuItem::ContextMenuItem): (WebCore::ContextMenuItem::setSubMenu): * platform/qt/ContextMenuQt.cpp: (WebCore::platformMenuDescription): * platform/win/ContextMenuItemWin.cpp: (WebCore::ContextMenuItem::ContextMenuItem): (WebCore::ContextMenuItem::setSubMenu): * platform/win/ContextMenuWin.cpp: (WebCore::platformMenuDescription): WebKit2: Part of <rdar://problem/8613727> and https://bugs.webkit.org/show_bug.cgi?id=48720 Customizable context menu support in WebKit2. Reviewed by Darin Adler. This adds a BundlePageContextMenu client and lets WebKit2 consult it with the proposed list of WebContextMenuItems. There is no realistic API for the embedding app to actually inspect or create new WebContextMenuItems (will be "WKContextMenuItem") and that ability will come later. * WebKit2.pro: * WebKit2.xcodeproj/project.pbxproj: * win/WebKit2.vcproj: * Platform/Logging.cpp: (initializeLogChannelsIfNecessary): * Platform/Logging.h: * Shared/APIObject.h: * Shared/MutableArray.cpp: (WebKit::MutableArray::reserveCapacity): * Shared/MutableArray.h: * Shared/WebContextMenuItem.cpp: Added. (WebKit::WebContextMenuItem::WebContextMenuItem): (WebKit::WebContextMenuItem::data): * Shared/WebContextMenuItem.h: Added. (WebKit::WebContextMenuItem::create): (WebKit::WebContextMenuItem::type): * Shared/WebContextMenuItemData.cpp: (WebKit::WebContextMenuItemData::core): (WebKit::kitItems): (WebKit::coreItems): * Shared/WebContextMenuItemData.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetContextMenuClient): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp: Added. (WebKit::InjectedBundlePageContextMenuClient::InjectedBundlePageContextMenuClient): (WebKit::InjectedBundlePageContextMenuClient::initialize): (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems): * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h: Added. * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: (WebKit::WebContextMenuClient::getCustomMenuFromDefaultItems): Call through to the injected bundle client with the default items and convert the returned items back for WebCore to use. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::initializeInjectedBundleContextMenuClient): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::injectedBundleContextMenuClient): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42bd97cb