From ea3b59fc5c1ea6d6162d97aa0826694f4be2268e Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Tue, 17 Apr 2012 11:56:19 +0000 Subject: [PATCH] [EFL][WK2] Fix build break when CONTEXT_MENUS is disabled. https://bugs.webkit.org/show_bug.cgi?id=83285 Patch by Mariusz Grzegorczyk on 2012-04-17 Reviewed by Ryosuke Niwa. Source/WebCore: * platform/ContextMenuItem.h: Remove macro around enums - needed by InjectedBundle. (WebCore): * platform/Widget.h: Remove namespace WebCore for PlatformPageClient typedef. Source/WebKit/efl: Remove WebCore namespace from PageClientEfl. * WebCoreSupport/PageClientEfl.cpp: (WebCore): * WebCoreSupport/PageClientEfl.h: * ewk/ewk_private.h: (EWKPrivate): * ewk/ewk_view.cpp: (_Ewk_View_Private_Data): (_ewk_view_priv_new): (EWKPrivate::corePageClient): Source/WebKit2: Surround code related to context menu with ENABLE(CONTEXT_MENUS) macro. Add dummy functions for public API implementation related to context menu. * Shared/API/c/WKContextMenuItem.cpp: (WKContextMenuItemGetTypeID): (WKContextMenuItemCreateAsAction): (WKContextMenuItemCreateAsCheckableAction): (WKContextMenuItemCreateAsSubmenu): (WKContextMenuItemSeparatorItem): (WKContextMenuItemGetTag): (WKContextMenuItemGetType): (WKContextMenuItemCopyTitle): (WKContextMenuItemGetEnabled): (WKContextMenuItemGetChecked): (WKContextMenuCopySubmenuItems): (WKContextMenuItemGetUserData): (WKContextMenuItemSetUserData): * Shared/WebContextMenuItem.cpp: * Shared/WebContextMenuItem.h: * Shared/WebContextMenuItemData.cpp: * Shared/WebContextMenuItemData.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): * UIProcess/WebPageContextMenuClient.cpp: * UIProcess/WebPageContextMenuClient.h: * UIProcess/WebPageProxy.cpp: (WebKit): * UIProcess/WebPageProxy.h: (WebPageProxy): * UIProcess/WebPageProxy.messages.in: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetContextMenuClient): * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp: * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h: * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: * WebProcess/WebCoreSupport/WebContextMenuClient.h: * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp: * WebProcess/WebPage/WebContextMenu.cpp: * WebProcess/WebPage/WebContextMenu.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): (WebKit): (WebKit::handleMouseEvent): (WebKit::WebPage::mouseEvent): * WebProcess/WebPage/WebPage.h: (WebPage): * WebProcess/WebPage/WebPage.messages.in: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114367 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 11 +++++ Source/WebCore/platform/ContextMenuItem.h | 4 +- Source/WebCore/platform/Widget.h | 2 - Source/WebKit/efl/ChangeLog | 19 ++++++++ Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp | 4 +- Source/WebKit/efl/WebCoreSupport/PageClientEfl.h | 4 +- Source/WebKit/efl/ewk/ewk_private.h | 2 +- Source/WebKit/efl/ewk/ewk_view.cpp | 6 +-- Source/WebKit2/ChangeLog | 55 ++++++++++++++++++++++ Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp | 50 ++++++++++++++++++++ Source/WebKit2/Shared/WebContextMenuItem.cpp | 4 ++ Source/WebKit2/Shared/WebContextMenuItem.h | 3 ++ Source/WebKit2/Shared/WebContextMenuItemData.cpp | 4 ++ Source/WebKit2/Shared/WebContextMenuItemData.h | 3 ++ Source/WebKit2/UIProcess/API/C/WKPage.cpp | 2 + .../WebKit2/UIProcess/WebPageContextMenuClient.cpp | 4 ++ .../WebKit2/UIProcess/WebPageContextMenuClient.h | 3 ++ Source/WebKit2/UIProcess/WebPageProxy.cpp | 4 ++ Source/WebKit2/UIProcess/WebPageProxy.h | 8 ++++ Source/WebKit2/UIProcess/WebPageProxy.messages.in | 2 + .../InjectedBundle/API/c/WKBundlePage.cpp | 2 + .../InjectedBundlePageContextMenuClient.cpp | 4 ++ .../InjectedBundlePageContextMenuClient.h | 3 ++ .../WebCoreSupport/WebContextMenuClient.cpp | 4 ++ .../WebCoreSupport/WebContextMenuClient.h | 3 ++ .../WebCoreSupport/efl/WebContextMenuClientEfl.cpp | 4 ++ .../WebKit2/WebProcess/WebPage/WebContextMenu.cpp | 5 ++ Source/WebKit2/WebProcess/WebPage/WebContextMenu.h | 3 ++ Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 20 +++++++- Source/WebKit2/WebProcess/WebPage/WebPage.h | 18 +++++++ .../WebKit2/WebProcess/WebPage/WebPage.messages.in | 4 ++ 31 files changed, 251 insertions(+), 13 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index c6e396f..5961cdb 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2012-04-17 Mariusz Grzegorczyk + + [EFL][WK2] Fix build break when CONTEXT_MENUS is disabled. + https://bugs.webkit.org/show_bug.cgi?id=83285 + + Reviewed by Ryosuke Niwa. + + * platform/ContextMenuItem.h: Remove macro around enums - needed by InjectedBundle. + (WebCore): + * platform/Widget.h: Remove namespace WebCore for PlatformPageClient typedef. + 2012-04-17 Kent Tamura Introduce an internal feature for a fixed placeholder diff --git a/Source/WebCore/platform/ContextMenuItem.h b/Source/WebCore/platform/ContextMenuItem.h index 6348688..f97e2fb 100644 --- a/Source/WebCore/platform/ContextMenuItem.h +++ b/Source/WebCore/platform/ContextMenuItem.h @@ -44,6 +44,7 @@ typedef struct _GtkAction GtkAction; #elif PLATFORM(WX) class wxMenuItem; #endif +#endif // ENABLE(CONTEXT_MENUS) namespace WebCore { @@ -175,6 +176,7 @@ namespace WebCore { SubmenuType }; +#if ENABLE(CONTEXT_MENUS) #if PLATFORM(MAC) typedef NSMenuItem* PlatformMenuItemDescription; #elif PLATFORM(QT) @@ -303,7 +305,7 @@ namespace WebCore { #endif // USE(CROSS_PLATFORM_CONTEXT_MENUS) }; +#endif // ENABLE(CONTEXT_MENUS) } -#endif // ENABLE(CONTEXT_MENUS) #endif // ContextMenuItem_h diff --git a/Source/WebCore/platform/Widget.h b/Source/WebCore/platform/Widget.h index 0d7cfd2..ffa1cc0 100644 --- a/Source/WebCore/platform/Widget.h +++ b/Source/WebCore/platform/Widget.h @@ -91,10 +91,8 @@ typedef QWebPageClient* PlatformPageClient; #include "PageClientBlackBerry.h" typedef PageClientBlackBerry* PlatformPageClient; #elif PLATFORM(EFL) -namespace WebCore { class PageClientEfl; typedef PageClientEfl* PlatformPageClient; -} #else typedef PlatformWidget PlatformPageClient; #endif diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index cbdbe04..ce093f8 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,22 @@ +2012-04-17 Mariusz Grzegorczyk + + [EFL][WK2] Fix build break when CONTEXT_MENUS is disabled. + https://bugs.webkit.org/show_bug.cgi?id=83285 + + Reviewed by Ryosuke Niwa. + + Remove WebCore namespace from PageClientEfl. + + * WebCoreSupport/PageClientEfl.cpp: + (WebCore): + * WebCoreSupport/PageClientEfl.h: + * ewk/ewk_private.h: + (EWKPrivate): + * ewk/ewk_view.cpp: + (_Ewk_View_Private_Data): + (_ewk_view_priv_new): + (EWKPrivate::corePageClient): + 2012-04-13 Thiago Marcos P. Santos [EFL] Add API for color chooser diff --git a/Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp index 5e65ede..25fbd75 100644 --- a/Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp @@ -23,6 +23,8 @@ #include "ewk_private.h" namespace WebCore { +class IntRect; +} PageClientEfl::PageClientEfl(Evas_Object* view) : m_view(view) @@ -45,5 +47,3 @@ GraphicsContext3D* PageClientEfl::acceleratedCompositingContext() return ewk_view_accelerated_compositing_context_get(m_view); } #endif - -} diff --git a/Source/WebKit/efl/WebCoreSupport/PageClientEfl.h b/Source/WebKit/efl/WebCoreSupport/PageClientEfl.h index f541303..b95823c 100644 --- a/Source/WebKit/efl/WebCoreSupport/PageClientEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/PageClientEfl.h @@ -26,8 +26,8 @@ typedef struct _Evas_Native_Surface Evas_Native_Surface; typedef struct _Evas_Object Evas_Object; namespace WebCore { - class GraphicsContext3D; +} // namespace WebCore class PageClientEfl { public: @@ -45,6 +45,4 @@ protected: Evas_Object* m_view; }; -} // namespace WebCore - #endif // PageClientEfl_h diff --git a/Source/WebKit/efl/ewk/ewk_private.h b/Source/WebKit/efl/ewk/ewk_private.h index 96fa753..26409e3 100644 --- a/Source/WebKit/efl/ewk/ewk_private.h +++ b/Source/WebKit/efl/ewk/ewk_private.h @@ -98,7 +98,7 @@ namespace EWKPrivate { WebCore::Frame *coreFrame(const Evas_Object *ewkFrame); WebCore::Page *corePage(const Evas_Object *ewkView); WebCore::HistoryItem *coreHistoryItem(const Ewk_History_Item *ewkHistoryItem); -WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView); +PlatformPageClient corePageClient(Evas_Object* ewkView); Evas_Object* kitFrame(const WebCore::Frame* coreFrame); diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index c65acab..1860aaad 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -159,7 +159,7 @@ struct _Ewk_View_Private_Data { WebCore::Frame* mainFrame; WebCore::ViewportArguments viewportArguments; Ewk_History* history; - OwnPtr pageClient; + OwnPtr pageClient; #if ENABLE(INPUT_TYPE_COLOR) WebCore::ColorChooserClient* colorChooserClient; #endif @@ -741,7 +741,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) priv->soupSession = WebCore::ResourceHandle::defaultSession(); - priv->pageClient = adoptPtr(new WebCore::PageClientEfl(smartData->self)); + priv->pageClient = adoptPtr(new PageClientEfl(smartData->self)); return priv; } @@ -4056,7 +4056,7 @@ WebCore::Page *corePage(const Evas_Object *ewkView) return priv->page.get(); } -WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView) +PlatformPageClient corePageClient(Evas_Object* ewkView) { EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0); EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0); diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 86f03b4..64ddc57 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,58 @@ +2012-04-17 Mariusz Grzegorczyk + + [EFL][WK2] Fix build break when CONTEXT_MENUS is disabled. + https://bugs.webkit.org/show_bug.cgi?id=83285 + + Reviewed by Ryosuke Niwa. + + Surround code related to context menu with ENABLE(CONTEXT_MENUS) macro. + Add dummy functions for public API implementation related to context menu. + + * Shared/API/c/WKContextMenuItem.cpp: + (WKContextMenuItemGetTypeID): + (WKContextMenuItemCreateAsAction): + (WKContextMenuItemCreateAsCheckableAction): + (WKContextMenuItemCreateAsSubmenu): + (WKContextMenuItemSeparatorItem): + (WKContextMenuItemGetTag): + (WKContextMenuItemGetType): + (WKContextMenuItemCopyTitle): + (WKContextMenuItemGetEnabled): + (WKContextMenuItemGetChecked): + (WKContextMenuCopySubmenuItems): + (WKContextMenuItemGetUserData): + (WKContextMenuItemSetUserData): + * Shared/WebContextMenuItem.cpp: + * Shared/WebContextMenuItem.h: + * Shared/WebContextMenuItemData.cpp: + * Shared/WebContextMenuItemData.h: + * UIProcess/API/C/WKPage.cpp: + (WKPageSetPageContextMenuClient): + * UIProcess/WebPageContextMenuClient.cpp: + * UIProcess/WebPageContextMenuClient.h: + * UIProcess/WebPageProxy.cpp: + (WebKit): + * UIProcess/WebPageProxy.h: + (WebPageProxy): + * UIProcess/WebPageProxy.messages.in: + * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: + (WKBundlePageSetContextMenuClient): + * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp: + * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h: + * WebProcess/WebCoreSupport/WebContextMenuClient.cpp: + * WebProcess/WebCoreSupport/WebContextMenuClient.h: + * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp: + * WebProcess/WebPage/WebContextMenu.cpp: + * WebProcess/WebPage/WebContextMenu.h: + * WebProcess/WebPage/WebPage.cpp: + (WebKit::WebPage::WebPage): + (WebKit): + (WebKit::handleMouseEvent): + (WebKit::WebPage::mouseEvent): + * WebProcess/WebPage/WebPage.h: + (WebPage): + * WebProcess/WebPage/WebPage.messages.in: + 2012-04-16 Ryuan Choi [EFL][WK2] Add missing files to build webkit2/Efl. diff --git a/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp b/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp index c04aab1..f383686 100644 --- a/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp +++ b/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp @@ -37,65 +37,115 @@ using namespace WebKit; WKTypeID WKContextMenuItemGetTypeID() { +#if ENABLE(CONTEXT_MENUS) return toAPI(WebContextMenuItem::APIType); +#else + return toAPI(APIObject::TypeNull); +#endif } WKContextMenuItemRef WKContextMenuItemCreateAsAction(WKContextMenuItemTag tag, WKStringRef title, bool enabled) { +#if ENABLE(CONTEXT_MENUS) return toAPI(WebContextMenuItem::create(WebContextMenuItemData(ActionType, toImpl(tag), toImpl(title)->string(), enabled, false)).leakRef()); +#else + return 0; +#endif } WKContextMenuItemRef WKContextMenuItemCreateAsCheckableAction(WKContextMenuItemTag tag, WKStringRef title, bool enabled, bool checked) { +#if ENABLE(CONTEXT_MENUS) return toAPI(WebContextMenuItem::create(WebContextMenuItemData(CheckableActionType, toImpl(tag), toImpl(title)->string(), enabled, checked)).leakRef()); +#else + return 0; +#endif } WKContextMenuItemRef WKContextMenuItemCreateAsSubmenu(WKStringRef title, bool enabled, WKArrayRef submenuItems) { +#if ENABLE(CONTEXT_MENUS) return toAPI(WebContextMenuItem::create(toImpl(title)->string(), enabled, toImpl(submenuItems)).leakRef()); +#else + return 0; +#endif } WKContextMenuItemRef WKContextMenuItemSeparatorItem() { +#if ENABLE(CONTEXT_MENUS) return toAPI(WebContextMenuItem::separatorItem()); +#else + return 0; +#endif } WKContextMenuItemTag WKContextMenuItemGetTag(WKContextMenuItemRef itemRef) { +#if ENABLE(CONTEXT_MENUS) return toAPI(toImpl(itemRef)->data()->action()); +#else + return toAPI(ContextMenuItemTagNoAction); +#endif } WKContextMenuItemType WKContextMenuItemGetType(WKContextMenuItemRef itemRef) { +#if ENABLE(CONTEXT_MENUS) return toAPI(toImpl(itemRef)->data()->type()); +#else + return toAPI(ActionType); +#endif } WKStringRef WKContextMenuItemCopyTitle(WKContextMenuItemRef itemRef) { +#if ENABLE(CONTEXT_MENUS) return toCopiedAPI(toImpl(itemRef)->data()->title().impl()); +#else + return 0; +#endif } bool WKContextMenuItemGetEnabled(WKContextMenuItemRef itemRef) { +#if ENABLE(CONTEXT_MENUS) return toImpl(itemRef)->data()->enabled(); +#else + return false; +#endif } bool WKContextMenuItemGetChecked(WKContextMenuItemRef itemRef) { +#if ENABLE(CONTEXT_MENUS) return toImpl(itemRef)->data()->checked(); +#else + return false; +#endif } WKArrayRef WKContextMenuCopySubmenuItems(WKContextMenuItemRef itemRef) { +#if ENABLE(CONTEXT_MENUS) return toAPI(toImpl(itemRef)->submenuItemsAsImmutableArray().leakRef()); +#else + return 0; +#endif } WKTypeRef WKContextMenuItemGetUserData(WKContextMenuItemRef itemRef) { +#if ENABLE(CONTEXT_MENUS) return toAPI(toImpl(itemRef)->userData()); +#else + return 0; +#endif } void WKContextMenuItemSetUserData(WKContextMenuItemRef itemRef, WKTypeRef userDataRef) { +#if ENABLE(CONTEXT_MENUS) toImpl(itemRef)->setUserData(toImpl(userDataRef)); +#endif } diff --git a/Source/WebKit2/Shared/WebContextMenuItem.cpp b/Source/WebKit2/Shared/WebContextMenuItem.cpp index f312997..4c6b464 100644 --- a/Source/WebKit2/Shared/WebContextMenuItem.cpp +++ b/Source/WebKit2/Shared/WebContextMenuItem.cpp @@ -24,6 +24,9 @@ */ #include "config.h" + +#if ENABLE(CONTEXT_MENUS) + #include "WebContextMenuItem.h" #include "ImmutableArray.h" @@ -87,3 +90,4 @@ void WebContextMenuItem::setUserData(APIObject* userData) } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit2/Shared/WebContextMenuItem.h b/Source/WebKit2/Shared/WebContextMenuItem.h index 142b811..893dd5b 100644 --- a/Source/WebKit2/Shared/WebContextMenuItem.h +++ b/Source/WebKit2/Shared/WebContextMenuItem.h @@ -26,6 +26,8 @@ #ifndef WebContextMenuItem_h #define WebContextMenuItem_h +#if ENABLE(CONTEXT_MENUS) + #include "APIObject.h" #include "WebContextMenuItemData.h" @@ -61,4 +63,5 @@ private: } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) #endif // WebContextMenuItem_h diff --git a/Source/WebKit2/Shared/WebContextMenuItemData.cpp b/Source/WebKit2/Shared/WebContextMenuItemData.cpp index e872047..1eb1c49 100644 --- a/Source/WebKit2/Shared/WebContextMenuItemData.cpp +++ b/Source/WebKit2/Shared/WebContextMenuItemData.cpp @@ -24,6 +24,9 @@ */ #include "config.h" + +#if ENABLE(CONTEXT_MENUS) + #include "WebContextMenuItemData.h" #include "APIObject.h" @@ -156,3 +159,4 @@ Vector coreItems(const Vector& kitItemV } } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit2/Shared/WebContextMenuItemData.h b/Source/WebKit2/Shared/WebContextMenuItemData.h index 24af288..106bdf0 100644 --- a/Source/WebKit2/Shared/WebContextMenuItemData.h +++ b/Source/WebKit2/Shared/WebContextMenuItemData.h @@ -26,6 +26,8 @@ #ifndef WebContextMenuItemData_h #define WebContextMenuItemData_h +#if ENABLE(CONTEXT_MENUS) + #include #include @@ -79,4 +81,5 @@ Vector coreItems(const Vector& } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) #endif // WebContextMenuItemData_h diff --git a/Source/WebKit2/UIProcess/API/C/WKPage.cpp b/Source/WebKit2/UIProcess/API/C/WKPage.cpp index 645e2f9..e5682ca 100644 --- a/Source/WebKit2/UIProcess/API/C/WKPage.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKPage.cpp @@ -461,7 +461,9 @@ void WKPageCountStringMatches(WKPageRef pageRef, WKStringRef string, WKFindOptio void WKPageSetPageContextMenuClient(WKPageRef pageRef, const WKPageContextMenuClient* wkClient) { +#if ENABLE(CONTEXT_MENUS) toImpl(pageRef)->initializeContextMenuClient(wkClient); +#endif } void WKPageSetPageFindClient(WKPageRef pageRef, const WKPageFindClient* wkClient) diff --git a/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp b/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp index 3f7d028..8a11ebb 100644 --- a/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp +++ b/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp @@ -24,6 +24,9 @@ */ #include "config.h" + +#if ENABLE(CONTEXT_MENUS) + #include "WebPageContextMenuClient.h" #include "Logging.h" @@ -91,3 +94,4 @@ void WebPageContextMenuClient::contextMenuDismissed(WebPageProxy* page) } } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit2/UIProcess/WebPageContextMenuClient.h b/Source/WebKit2/UIProcess/WebPageContextMenuClient.h index 9e738bb..dff9019 100644 --- a/Source/WebKit2/UIProcess/WebPageContextMenuClient.h +++ b/Source/WebKit2/UIProcess/WebPageContextMenuClient.h @@ -26,6 +26,8 @@ #ifndef WebPageContextMenuClient_h #define WebPageContextMenuClient_h +#if ENABLE(CONTEXT_MENUS) + #include "APIClient.h" #include "WebHitTestResult.h" #include "WKPage.h" @@ -46,4 +48,5 @@ public: } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) #endif // WebPageContextMenuClient_h diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp index 12d9613..c5f0e49 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.cpp +++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp @@ -297,10 +297,12 @@ void WebPageProxy::initializeFindClient(const WKPageFindClient* client) m_findClient.initialize(client); } +#if ENABLE(CONTEXT_MENUS) void WebPageProxy::initializeContextMenuClient(const WKPageContextMenuClient* client) { m_contextMenuClient.initialize(client); } +#endif void WebPageProxy::reattachToWebProcess() { @@ -2695,6 +2697,7 @@ void WebPageProxy::hidePopupMenu() m_activePopupMenu = 0; } +#if ENABLE(CONTEXT_MENUS) void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector& proposedItems, CoreIPC::ArgumentDecoder* arguments) { internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments); @@ -2804,6 +2807,7 @@ void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item) process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID); } +#endif // ENABLE(CONTEXT_MENUS) void WebPageProxy::didChooseFilesForOpenPanel(const Vector& fileURLs) { diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h index 25e639a..b43fd1e 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.h +++ b/Source/WebKit2/UIProcess/WebPageProxy.h @@ -239,7 +239,9 @@ public: WebFullScreenManagerProxy* fullScreenManager(); #endif +#if ENABLE(CONTEXT_MENUS) void initializeContextMenuClient(const WKPageContextMenuClient*); +#endif void initializeFindClient(const WKPageFindClient*); void initializeFormClient(const WKPageFormClient*); void initializeLoaderClient(const WKPageLoaderClient*); @@ -566,8 +568,10 @@ public: void preferencesDidChange(); +#if ENABLE(CONTEXT_MENUS) // Called by the WebContextMenuProxy. void contextMenuItemSelected(const WebContextMenuItemData&); +#endif // Called by the WebOpenPanelResultListenerProxy. void didChooseFilesForOpenPanel(const Vector&); @@ -791,9 +795,11 @@ private: void setPopupMenuSelectedIndex(int32_t); #endif +#if ENABLE(CONTEXT_MENUS) // Context Menu. void showContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector&, CoreIPC::ArgumentDecoder*); void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector&, CoreIPC::ArgumentDecoder*); +#endif // Search popup results void saveRecentSearches(const String&, const Vector&); @@ -892,7 +898,9 @@ private: WebResourceLoadClient m_resourceLoadClient; WebUIClient m_uiClient; WebFindClient m_findClient; +#if ENABLE(CONTEXT_MENUS) WebPageContextMenuClient m_contextMenuClient; +#endif OwnPtr m_drawingArea; RefPtr m_process; diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in index c850760..d718115 100644 --- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in +++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in @@ -196,8 +196,10 @@ messages -> WebPageProxy { SetPopupMenuSelectedIndex(int32_t selectedIndex) #endif +#if ENABLE(CONTEXT_MENUS) # ContextMenu messages ShowContextMenu(WebCore::IntPoint menuLocation, WebKit::WebHitTestResult::Data hitTestResultData, Vector items, WebKit::InjectedBundleUserMessageEncoder userData) +#endif # Authentication messages CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate) diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp index 4a9ee05..c7fe682 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp @@ -54,7 +54,9 @@ WKTypeID WKBundlePageGetTypeID() void WKBundlePageSetContextMenuClient(WKBundlePageRef pageRef, WKBundlePageContextMenuClient* wkClient) { +#if ENABLE(CONTEXT_MENUS) toImpl(pageRef)->initializeInjectedBundleContextMenuClient(wkClient); +#endif } void WKBundlePageSetEditorClient(WKBundlePageRef pageRef, WKBundlePageEditorClient* wkClient) diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp index 9df0081..3cd8dfa 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp +++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp @@ -24,6 +24,9 @@ */ #include "config.h" + +#if ENABLE(CONTEXT_MENUS) + #include "InjectedBundlePageContextMenuClient.h" #include "ImmutableArray.h" @@ -75,3 +78,4 @@ bool InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems(WebPage* } } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h index 0d8ea5f..6a81d05 100644 --- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h +++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h @@ -26,6 +26,8 @@ #ifndef InjectedBundlePageContextMenuClient_h #define InjectedBundlePageContextMenuClient_h +#if ENABLE(CONTEXT_MENUS) + #include "APIClient.h" #include "WKBundlePage.h" #include @@ -48,4 +50,5 @@ public: } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) #endif // InjectedBundlePageEditorClient_h diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp index bab9ff1..e3af6fc 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp @@ -24,6 +24,9 @@ */ #include "config.h" + +#if ENABLE(CONTEXT_MENUS) + #include "WebContextMenuClient.h" #include "WebContextMenu.h" @@ -96,3 +99,4 @@ void WebContextMenuClient::showContextMenu() #endif } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h index 86b0a48..96e2ee6 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h +++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h @@ -26,6 +26,8 @@ #ifndef WebContextMenuClient_h #define WebContextMenuClient_h +#if ENABLE(CONTEXT_MENUS) + #include namespace WebKit { @@ -69,4 +71,5 @@ private: } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) #endif // WebContextMenuClient_h diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp index 62d7b84..0b010ef 100644 --- a/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp +++ b/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp @@ -24,6 +24,9 @@ */ #include "config.h" + +#if ENABLE(CONTEXT_MENUS) + #include "WebContextMenuClient.h" #include @@ -54,3 +57,4 @@ void WebContextMenuClient::stopSpeaking() } } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp b/Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp index 8ed6741..3a91d90 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp @@ -20,6 +20,9 @@ */ #include "config.h" + +#if ENABLE(CONTEXT_MENUS) + #include "WebContextMenu.h" #include "InjectedBundleHitTestResult.h" @@ -93,3 +96,5 @@ void WebContextMenu::itemSelected(const WebContextMenuItemData& item) } } // namespace WebKit + +#endif // ENABLE(CONTEXT_MENUS) diff --git a/Source/WebKit2/WebProcess/WebPage/WebContextMenu.h b/Source/WebKit2/WebProcess/WebPage/WebContextMenu.h index 3d9291a..c8a5f5a 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebContextMenu.h +++ b/Source/WebKit2/WebProcess/WebPage/WebContextMenu.h @@ -21,6 +21,8 @@ #ifndef WebContextMenu_h #define WebContextMenu_h +#if ENABLE(CONTEXT_MENUS) + #include "WebContextMenuItemData.h" #include @@ -50,4 +52,5 @@ private: } // namespace WebKit +#endif // ENABLE(CONTEXT_MENUS) #endif // WebPopupMenu_h diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 6eaecc7..c5a0c12 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -215,7 +215,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) , m_canShortCircuitHorizontalWheelEvents(false) , m_numWheelEventHandlers(0) , m_cachedPageCount(0) +#if ENABLE(CONTEXT_MENUS) , m_isShowingContextMenu(false) +#endif , m_willGoToBackForwardItemCallbackEnabled(true) #if PLATFORM(WIN) , m_gestureReachedScrollingLimit(false) @@ -228,7 +230,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) Page::PageClients pageClients; pageClients.chromeClient = new WebChromeClient(this); +#if ENABLE(CONTEXT_MENUS) pageClients.contextMenuClient = new WebContextMenuClient(this); +#endif pageClients.editorClient = new WebEditorClient(this); pageClients.dragClient = new WebDragClient(this); pageClients.backForwardClient = WebBackForwardListProxy::create(this); @@ -327,10 +331,12 @@ CoreIPC::Connection* WebPage::connection() const return WebProcess::shared().connection(); } +#if ENABLE(CONTEXT_MENUS) void WebPage::initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient* client) { m_contextMenuClient.initialize(client); } +#endif void WebPage::initializeInjectedBundleEditorClient(WKBundlePageEditorClient* client) { @@ -1197,12 +1203,14 @@ void WebPage::pageDidRequestScroll(const IntPoint& point) } #endif +#if ENABLE(CONTEXT_MENUS) WebContextMenu* WebPage::contextMenu() { if (!m_contextMenu) m_contextMenu = WebContextMenu::create(this); return m_contextMenu.get(); } +#endif // Events @@ -1233,6 +1241,7 @@ private: const WebEvent* m_previousCurrentEvent; }; +#if ENABLE(CONTEXT_MENUS) static bool isContextClick(const PlatformMouseEvent& event) { if (event.button() == WebCore::RightButton) @@ -1262,6 +1271,7 @@ static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, return handled; } +#endif static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, bool onlyUpdateScrollbars) { @@ -1273,12 +1283,16 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, boo switch (platformMouseEvent.type()) { case PlatformEvent::MousePressed: { +#if ENABLE(CONTEXT_MENUS) if (isContextClick(platformMouseEvent)) page->corePage()->contextMenuController()->clearContextMenu(); - +#endif + bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent); +#if ENABLE(CONTEXT_MENUS) if (isContextClick(platformMouseEvent)) handled = handleContextMenuEvent(platformMouseEvent, page); +#endif return handled; } @@ -1296,11 +1310,13 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, boo void WebPage::mouseEvent(const WebMouseEvent& mouseEvent) { +#if ENABLE(CONTEXT_MENUS) // Don't try to handle any pending mouse events if a context menu is showing. if (m_isShowingContextMenu) { send(Messages::WebPageProxy::DidReceiveEvent(static_cast(mouseEvent.type()), false)); return; } +#endif bool handled = false; @@ -2393,6 +2409,7 @@ void WebPage::failedToShowPopupMenu() } #endif +#if ENABLE(CONTEXT_MENUS) void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& item) { if (!m_contextMenu) @@ -2401,6 +2418,7 @@ void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& i m_contextMenu->itemSelected(item); m_contextMenu = 0; } +#endif void WebPage::replaceSelectionWithText(Frame* frame, const String& text) { diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 7d52d4c..231a895 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -32,7 +32,9 @@ #include "GeolocationPermissionRequestManager.h" #include "ImageOptions.h" #include "ImmutableArray.h" +#if ENABLE(CONTEXT_MENUS) #include "InjectedBundlePageContextMenuClient.h" +#endif #include "InjectedBundlePageEditorClient.h" #include "InjectedBundlePageFormClient.h" #include "InjectedBundlePageFullScreenClient.h" @@ -216,7 +218,9 @@ public: void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr&); // -- InjectedBundle methods +#if ENABLE(CONTEXT_MENUS) void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*); +#endif void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*); void initializeInjectedBundleFormClient(WKBundlePageFormClient*); void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*); @@ -227,7 +231,9 @@ public: void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*); #endif +#if ENABLE(CONTEXT_MENUS) InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; } +#endif InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; } InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; } InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; } @@ -347,7 +353,9 @@ public: WebCore::IntSize viewportSize() const { return m_viewportSize; } #endif +#if ENABLE(CONTEXT_MENUS) WebContextMenu* contextMenu(); +#endif bool hasLocalDataForURL(const WebCore::KURL&); String cachedResponseMIMETypeForURL(const WebCore::KURL&); @@ -499,7 +507,9 @@ public: void simulateMouseMotion(WebCore::IntPoint, double time); String viewportConfigurationAsText(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight); +#if ENABLE(CONTEXT_MENUS) void contextMenuShowing() { m_isShowingContextMenu = true; } +#endif #if PLATFORM(QT) void registerApplicationScheme(const String& scheme); @@ -579,7 +589,9 @@ private: void highlightPotentialActivation(const WebCore::IntPoint&, const WebCore::IntSize& area); #endif #endif +#if ENABLE(CONTEXT_MENUS) void contextMenuHidden() { m_isShowingContextMenu = false; } +#endif static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity); static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity); @@ -733,7 +745,9 @@ private: WebCore::IntSize m_windowResizerSize; +#if ENABLE(CONTEXT_MENUS) InjectedBundlePageContextMenuClient m_contextMenuClient; +#endif InjectedBundlePageEditorClient m_editorClient; InjectedBundlePageFormClient m_formClient; InjectedBundlePageLoaderClient m_loaderClient; @@ -763,7 +777,9 @@ private: RefPtr m_fullScreenManager; #endif RefPtr m_activePopupMenu; +#if ENABLE(CONTEXT_MENUS) RefPtr m_contextMenu; +#endif RefPtr m_activeOpenPanelResultListener; RefPtr m_notificationPermissionRequestManager; @@ -794,7 +810,9 @@ private: unsigned m_cachedPageCount; +#if ENABLE(CONTEXT_MENUS) bool m_isShowingContextMenu; +#endif bool m_willGoToBackForwardItemCallbackEnabled; diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index a640589..a7fdee8 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -44,7 +44,9 @@ messages -> WebPage { HighlightPotentialActivation(WebCore::IntPoint point, WebCore::IntSize area) #endif +#if ENABLE(CONTEXT_MENUS) ContextMenuHidden() +#endif ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity) CenterSelectionInVisibleArea() @@ -157,8 +159,10 @@ messages -> WebPage { FailedToShowPopupMenu(); #endif +#if ENABLE(CONTEXT_MENUS) # Context menu. DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem); +#endif # Open panel. DidChooseFilesForOpenPanel(Vector fileURLs) -- 2.7.4