[EFL][WK2] Fix build break when CONTEXT_MENUS is disabled.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 11:56:19 +0000 (11:56 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 11:56:19 +0000 (11:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83285

Patch by Mariusz Grzegorczyk <mariusz.g@samsung.com> 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

31 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/ContextMenuItem.h
Source/WebCore/platform/Widget.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/PageClientEfl.h
Source/WebKit/efl/ewk/ewk_private.h
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp
Source/WebKit2/Shared/WebContextMenuItem.cpp
Source/WebKit2/Shared/WebContextMenuItem.h
Source/WebKit2/Shared/WebContextMenuItemData.cpp
Source/WebKit2/Shared/WebContextMenuItemData.h
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp
Source/WebKit2/UIProcess/WebPageContextMenuClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h
Source/WebKit2/WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp
Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp
Source/WebKit2/WebProcess/WebPage/WebContextMenu.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

index c6e396f..5961cdb 100644 (file)
@@ -1,3 +1,14 @@
+2012-04-17  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
+
+        [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  <tkent@chromium.org>
 
         Introduce an internal feature for a fixed placeholder
index 6348688..f97e2fb 100644 (file)
@@ -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
index 0d7cfd2..ffa1cc0 100644 (file)
@@ -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
index cbdbe04..ce093f8 100644 (file)
@@ -1,3 +1,22 @@
+2012-04-17  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
+
+        [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  <thiago.santos@intel.com>
 
         [EFL] Add API for color chooser
index 5e65ede..25fbd75 100644 (file)
@@ -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
-
-}
index f541303..b95823c 100644 (file)
@@ -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
index 96fa753..26409e3 100644 (file)
@@ -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);
 
index c65acab..1860aaa 100644 (file)
@@ -159,7 +159,7 @@ struct _Ewk_View_Private_Data {
     WebCore::Frame* mainFrame;
     WebCore::ViewportArguments viewportArguments;
     Ewk_History* history;
-    OwnPtr<WebCore::PageClientEfl> pageClient;
+    OwnPtr<PageClientEfl> 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);
index 86f03b4..64ddc57 100644 (file)
@@ -1,3 +1,58 @@
+2012-04-17  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
+
+        [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  <ryuan.choi@samsung.com>
 
         [EFL][WK2] Add missing files to build webkit2/Efl.
index c04aab1..f383686 100644 (file)
@@ -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
 }
index f312997..4c6b464 100644 (file)
@@ -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)
index 142b811..893dd5b 100644 (file)
@@ -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
index e872047..1eb1c49 100644 (file)
@@ -24,6 +24,9 @@
  */
 
 #include "config.h"
+
+#if ENABLE(CONTEXT_MENUS)
+
 #include "WebContextMenuItemData.h"
 
 #include "APIObject.h"
@@ -156,3 +159,4 @@ Vector<ContextMenuItem> coreItems(const Vector<WebContextMenuItemData>& kitItemV
 }
 
 } // namespace WebKit
+#endif // ENABLE(CONTEXT_MENUS)
index 24af288..106bdf0 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef WebContextMenuItemData_h
 #define WebContextMenuItemData_h
 
+#if ENABLE(CONTEXT_MENUS)
+
 #include <WebCore/ContextMenuItem.h>
 #include <wtf/text/WTFString.h>
 
@@ -79,4 +81,5 @@ Vector<WebCore::ContextMenuItem> coreItems(const Vector<WebContextMenuItemData>&
 
 } // namespace WebKit
 
+#endif // ENABLE(CONTEXT_MENUS)
 #endif // WebContextMenuItemData_h
index 645e2f9..e5682ca 100644 (file)
@@ -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)
index 3f7d028..8a11ebb 100644 (file)
@@ -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)
index 9e738bb..dff9019 100644 (file)
@@ -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
index 12d9613..c5f0e49 100644 (file)
@@ -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<WebContextMenuItemData>& 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<String>& fileURLs)
 {
index 25e639a..b43fd1e 100644 (file)
@@ -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<String>&);
@@ -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<WebContextMenuItemData>&, CoreIPC::ArgumentDecoder*);
     void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::ArgumentDecoder*);
+#endif
 
     // Search popup results
     void saveRecentSearches(const String&, const Vector<String>&);
@@ -892,7 +898,9 @@ private:
     WebResourceLoadClient m_resourceLoadClient;
     WebUIClient m_uiClient;
     WebFindClient m_findClient;
+#if ENABLE(CONTEXT_MENUS)
     WebPageContextMenuClient m_contextMenuClient;
+#endif
 
     OwnPtr<DrawingAreaProxy> m_drawingArea;
     RefPtr<WebProcessProxy> m_process;
index c850760..d718115 100644 (file)
@@ -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<WebKit::WebContextMenuItemData> items, WebKit::InjectedBundleUserMessageEncoder userData)
+#endif
 
     # Authentication messages
     CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate)
index 4a9ee05..c7fe682 100644 (file)
@@ -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)
index 9df0081..3cd8dfa 100644 (file)
@@ -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)
index 0d8ea5f..6a81d05 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef InjectedBundlePageContextMenuClient_h
 #define InjectedBundlePageContextMenuClient_h
 
+#if ENABLE(CONTEXT_MENUS)
+
 #include "APIClient.h"
 #include "WKBundlePage.h"
 #include <wtf/Vector.h>
@@ -48,4 +50,5 @@ public:
 
 } // namespace WebKit
 
+#endif // ENABLE(CONTEXT_MENUS)
 #endif // InjectedBundlePageEditorClient_h
index bab9ff1..e3af6fc 100644 (file)
@@ -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)
index 86b0a48..96e2ee6 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef WebContextMenuClient_h
 #define WebContextMenuClient_h
 
+#if ENABLE(CONTEXT_MENUS)
+
 #include <WebCore/ContextMenuClient.h>
 
 namespace WebKit {
@@ -69,4 +71,5 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(CONTEXT_MENUS)
 #endif // WebContextMenuClient_h
index 62d7b84..0b010ef 100644 (file)
@@ -24,6 +24,9 @@
  */
 
 #include "config.h"
+
+#if ENABLE(CONTEXT_MENUS)
+
 #include "WebContextMenuClient.h"
 
 #include <WebCore/NotImplemented.h>
@@ -54,3 +57,4 @@ void WebContextMenuClient::stopSpeaking()
 }
 
 } // namespace WebKit
+#endif // ENABLE(CONTEXT_MENUS)
index 8ed6741..3a91d90 100644 (file)
@@ -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)
index 3d9291a..c8a5f5a 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef WebContextMenu_h
 #define WebContextMenu_h
 
+#if ENABLE(CONTEXT_MENUS)
+
 #include "WebContextMenuItemData.h"
 
 #include <wtf/PassRefPtr.h>
@@ -50,4 +52,5 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(CONTEXT_MENUS)
 #endif // WebPopupMenu_h
index 6eaecc7..c5a0c12 100644 (file)
@@ -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<uint32_t>(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)
 {
index 7d52d4c..231a895 100644 (file)
@@ -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<CoreIPC::ArgumentEncoder>&);
 
     // -- 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<WebFullScreenManager> m_fullScreenManager;
 #endif
     RefPtr<WebPopupMenu> m_activePopupMenu;
+#if ENABLE(CONTEXT_MENUS)
     RefPtr<WebContextMenu> m_contextMenu;
+#endif
     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
 
@@ -794,7 +810,9 @@ private:
 
     unsigned m_cachedPageCount;
 
+#if ENABLE(CONTEXT_MENUS)
     bool m_isShowingContextMenu;
+#endif
     
     bool m_willGoToBackForwardItemCallbackEnabled;
 
index a640589..a7fdee8 100644 (file)
@@ -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<WTF::String> fileURLs)