Changeset 114367 in webkit


Ignore:
Timestamp:
Apr 17, 2012 4:56:19 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL][WK2] Fix build break when CONTEXT_MENUS is disabled.
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:
Location:
trunk/Source
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r114360 r114367  
     12012-04-17  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
     2
     3        [EFL][WK2] Fix build break when CONTEXT_MENUS is disabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=83285
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * platform/ContextMenuItem.h: Remove macro around enums - needed by InjectedBundle.
     9        (WebCore):
     10        * platform/Widget.h: Remove namespace WebCore for PlatformPageClient typedef.
     11
    1122012-04-17  Kent Tamura  <tkent@chromium.org>
    213
  • trunk/Source/WebCore/platform/ContextMenuItem.h

    r113147 r114367  
    4545class wxMenuItem;
    4646#endif
     47#endif // ENABLE(CONTEXT_MENUS)
    4748
    4849namespace WebCore {
     
    176177    };
    177178
     179#if ENABLE(CONTEXT_MENUS)
    178180#if PLATFORM(MAC)
    179181    typedef NSMenuItem* PlatformMenuItemDescription;
     
    304306    };
    305307
     308#endif // ENABLE(CONTEXT_MENUS)
    306309}
    307310
    308 #endif // ENABLE(CONTEXT_MENUS)
    309311#endif // ContextMenuItem_h
  • trunk/Source/WebCore/platform/Widget.h

    r111673 r114367  
    9292typedef PageClientBlackBerry* PlatformPageClient;
    9393#elif PLATFORM(EFL)
    94 namespace WebCore {
    9594class PageClientEfl;
    9695typedef PageClientEfl* PlatformPageClient;
    97 }
    9896#else
    9997typedef PlatformWidget PlatformPageClient;
  • trunk/Source/WebKit/efl/ChangeLog

    r114113 r114367  
     12012-04-17  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
     2
     3        [EFL][WK2] Fix build break when CONTEXT_MENUS is disabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=83285
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Remove WebCore namespace from PageClientEfl.
     9
     10        * WebCoreSupport/PageClientEfl.cpp:
     11        (WebCore):
     12        * WebCoreSupport/PageClientEfl.h:
     13        * ewk/ewk_private.h:
     14        (EWKPrivate):
     15        * ewk/ewk_view.cpp:
     16        (_Ewk_View_Private_Data):
     17        (_ewk_view_priv_new):
     18        (EWKPrivate::corePageClient):
     19
    1202012-04-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
    221
  • trunk/Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp

    r111673 r114367  
    2424
    2525namespace WebCore {
     26class IntRect;
     27}
    2628
    2729PageClientEfl::PageClientEfl(Evas_Object* view)
     
    4648}
    4749#endif
    48 
    49 }
  • trunk/Source/WebKit/efl/WebCoreSupport/PageClientEfl.h

    r111673 r114367  
    2727
    2828namespace WebCore {
    29 
    3029class GraphicsContext3D;
     30} // namespace WebCore
    3131
    3232class PageClientEfl {
     
    4646};
    4747
    48 } // namespace WebCore
    49 
    5048#endif // PageClientEfl_h
  • trunk/Source/WebKit/efl/ewk/ewk_private.h

    r114113 r114367  
    9999WebCore::Page *corePage(const Evas_Object *ewkView);
    100100WebCore::HistoryItem *coreHistoryItem(const Ewk_History_Item *ewkHistoryItem);
    101 WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView);
     101PlatformPageClient corePageClient(Evas_Object* ewkView);
    102102
    103103Evas_Object* kitFrame(const WebCore::Frame* coreFrame);
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r114113 r114367  
    160160    WebCore::ViewportArguments viewportArguments;
    161161    Ewk_History* history;
    162     OwnPtr<WebCore::PageClientEfl> pageClient;
     162    OwnPtr<PageClientEfl> pageClient;
    163163#if ENABLE(INPUT_TYPE_COLOR)
    164164    WebCore::ColorChooserClient* colorChooserClient;
     
    742742    priv->soupSession = WebCore::ResourceHandle::defaultSession();
    743743
    744     priv->pageClient = adoptPtr(new WebCore::PageClientEfl(smartData->self));
     744    priv->pageClient = adoptPtr(new PageClientEfl(smartData->self));
    745745
    746746    return priv;
     
    40574057}
    40584058
    4059 WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView)
     4059PlatformPageClient corePageClient(Evas_Object* ewkView)
    40604060{
    40614061    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
  • trunk/Source/WebKit2/ChangeLog

    r114345 r114367  
     12012-04-17  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
     2
     3        [EFL][WK2] Fix build break when CONTEXT_MENUS is disabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=83285
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Surround code related to context menu with ENABLE(CONTEXT_MENUS) macro.
     9        Add dummy functions for public API implementation related to context menu.
     10
     11        * Shared/API/c/WKContextMenuItem.cpp:
     12        (WKContextMenuItemGetTypeID):
     13        (WKContextMenuItemCreateAsAction):
     14        (WKContextMenuItemCreateAsCheckableAction):
     15        (WKContextMenuItemCreateAsSubmenu):
     16        (WKContextMenuItemSeparatorItem):
     17        (WKContextMenuItemGetTag):
     18        (WKContextMenuItemGetType):
     19        (WKContextMenuItemCopyTitle):
     20        (WKContextMenuItemGetEnabled):
     21        (WKContextMenuItemGetChecked):
     22        (WKContextMenuCopySubmenuItems):
     23        (WKContextMenuItemGetUserData):
     24        (WKContextMenuItemSetUserData):
     25        * Shared/WebContextMenuItem.cpp:
     26        * Shared/WebContextMenuItem.h:
     27        * Shared/WebContextMenuItemData.cpp:
     28        * Shared/WebContextMenuItemData.h:
     29        * UIProcess/API/C/WKPage.cpp:
     30        (WKPageSetPageContextMenuClient):
     31        * UIProcess/WebPageContextMenuClient.cpp:
     32        * UIProcess/WebPageContextMenuClient.h:
     33        * UIProcess/WebPageProxy.cpp:
     34        (WebKit):
     35        * UIProcess/WebPageProxy.h:
     36        (WebPageProxy):
     37        * UIProcess/WebPageProxy.messages.in:
     38        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
     39        (WKBundlePageSetContextMenuClient):
     40        * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
     41        * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
     42        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
     43        * WebProcess/WebCoreSupport/WebContextMenuClient.h:
     44        * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp:
     45        * WebProcess/WebPage/WebContextMenu.cpp:
     46        * WebProcess/WebPage/WebContextMenu.h:
     47        * WebProcess/WebPage/WebPage.cpp:
     48        (WebKit::WebPage::WebPage):
     49        (WebKit):
     50        (WebKit::handleMouseEvent):
     51        (WebKit::WebPage::mouseEvent):
     52        * WebProcess/WebPage/WebPage.h:
     53        (WebPage):
     54        * WebProcess/WebPage/WebPage.messages.in:
     55
    1562012-04-16  Ryuan Choi  <ryuan.choi@samsung.com>
    257
  • trunk/Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp

    r95901 r114367  
    3838WKTypeID WKContextMenuItemGetTypeID()
    3939{
     40#if ENABLE(CONTEXT_MENUS)
    4041    return toAPI(WebContextMenuItem::APIType);
     42#else
     43    return toAPI(APIObject::TypeNull);
     44#endif
    4145}
    4246
    4347WKContextMenuItemRef WKContextMenuItemCreateAsAction(WKContextMenuItemTag tag, WKStringRef title, bool enabled)
    4448{
     49#if ENABLE(CONTEXT_MENUS)
    4550    return toAPI(WebContextMenuItem::create(WebContextMenuItemData(ActionType, toImpl(tag), toImpl(title)->string(), enabled, false)).leakRef());
     51#else
     52    return 0;
     53#endif
    4654}
    4755
    4856WKContextMenuItemRef WKContextMenuItemCreateAsCheckableAction(WKContextMenuItemTag tag, WKStringRef title, bool enabled, bool checked)
    4957{
     58#if ENABLE(CONTEXT_MENUS)
    5059    return toAPI(WebContextMenuItem::create(WebContextMenuItemData(CheckableActionType, toImpl(tag), toImpl(title)->string(), enabled, checked)).leakRef());
     60#else
     61    return 0;
     62#endif
    5163}
    5264
    5365WKContextMenuItemRef WKContextMenuItemCreateAsSubmenu(WKStringRef title, bool enabled, WKArrayRef submenuItems)
    5466{
     67#if ENABLE(CONTEXT_MENUS)
    5568    return toAPI(WebContextMenuItem::create(toImpl(title)->string(), enabled, toImpl(submenuItems)).leakRef());
     69#else
     70    return 0;
     71#endif
    5672}
    5773
    5874WKContextMenuItemRef WKContextMenuItemSeparatorItem()
    5975{
     76#if ENABLE(CONTEXT_MENUS)
    6077    return toAPI(WebContextMenuItem::separatorItem());
     78#else
     79    return 0;
     80#endif
    6181}
    6282
    6383WKContextMenuItemTag WKContextMenuItemGetTag(WKContextMenuItemRef itemRef)
    6484{
     85#if ENABLE(CONTEXT_MENUS)
    6586    return toAPI(toImpl(itemRef)->data()->action());
     87#else
     88    return toAPI(ContextMenuItemTagNoAction);
     89#endif
    6690}
    6791
    6892WKContextMenuItemType WKContextMenuItemGetType(WKContextMenuItemRef itemRef)
    6993{
     94#if ENABLE(CONTEXT_MENUS)
    7095    return toAPI(toImpl(itemRef)->data()->type());
     96#else
     97    return toAPI(ActionType);
     98#endif
    7199}
    72100
    73101WKStringRef WKContextMenuItemCopyTitle(WKContextMenuItemRef itemRef)
    74102{
     103#if ENABLE(CONTEXT_MENUS)
    75104    return toCopiedAPI(toImpl(itemRef)->data()->title().impl());
     105#else
     106    return 0;
     107#endif
    76108}
    77109
    78110bool WKContextMenuItemGetEnabled(WKContextMenuItemRef itemRef)
    79111{
     112#if ENABLE(CONTEXT_MENUS)
    80113    return toImpl(itemRef)->data()->enabled();
     114#else
     115    return false;
     116#endif
    81117}
    82118
    83119bool WKContextMenuItemGetChecked(WKContextMenuItemRef itemRef)
    84120{
     121#if ENABLE(CONTEXT_MENUS)
    85122    return toImpl(itemRef)->data()->checked();
     123#else
     124    return false;
     125#endif
    86126}
    87127
    88128WKArrayRef WKContextMenuCopySubmenuItems(WKContextMenuItemRef itemRef)
    89129{
     130#if ENABLE(CONTEXT_MENUS)
    90131    return toAPI(toImpl(itemRef)->submenuItemsAsImmutableArray().leakRef());
     132#else
     133    return 0;
     134#endif
    91135}
    92136
    93137WKTypeRef WKContextMenuItemGetUserData(WKContextMenuItemRef itemRef)
    94138{
     139#if ENABLE(CONTEXT_MENUS)
    95140    return toAPI(toImpl(itemRef)->userData());
     141#else
     142    return 0;
     143#endif
    96144}
    97145
    98146void WKContextMenuItemSetUserData(WKContextMenuItemRef itemRef, WKTypeRef userDataRef)
    99147{
     148#if ENABLE(CONTEXT_MENUS)
    100149    toImpl(itemRef)->setUserData(toImpl(userDataRef));
     150#endif
    101151}
  • trunk/Source/WebKit2/Shared/WebContextMenuItem.cpp

    r95901 r114367  
    2525 
    2626#include "config.h"
     27
     28#if ENABLE(CONTEXT_MENUS)
     29
    2730#include "WebContextMenuItem.h"
    2831
     
    8891} // namespace WebKit
    8992
     93#endif // ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/Shared/WebContextMenuItem.h

    r95901 r114367  
    2626#ifndef WebContextMenuItem_h
    2727#define WebContextMenuItem_h
     28
     29#if ENABLE(CONTEXT_MENUS)
    2830
    2931#include "APIObject.h"
     
    6264} // namespace WebKit
    6365
     66#endif // ENABLE(CONTEXT_MENUS)
    6467#endif // WebContextMenuItem_h
  • trunk/Source/WebKit2/Shared/WebContextMenuItemData.cpp

    r95901 r114367  
    2525
    2626#include "config.h"
     27
     28#if ENABLE(CONTEXT_MENUS)
     29
    2730#include "WebContextMenuItemData.h"
    2831
     
    157160
    158161} // namespace WebKit
     162#endif // ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/Shared/WebContextMenuItemData.h

    r95901 r114367  
    2626#ifndef WebContextMenuItemData_h
    2727#define WebContextMenuItemData_h
     28
     29#if ENABLE(CONTEXT_MENUS)
    2830
    2931#include <WebCore/ContextMenuItem.h>
     
    8082} // namespace WebKit
    8183
     84#endif // ENABLE(CONTEXT_MENUS)
    8285#endif // WebContextMenuItemData_h
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r110638 r114367  
    462462void WKPageSetPageContextMenuClient(WKPageRef pageRef, const WKPageContextMenuClient* wkClient)
    463463{
     464#if ENABLE(CONTEXT_MENUS)
    464465    toImpl(pageRef)->initializeContextMenuClient(wkClient);
     466#endif
    465467}
    466468
  • trunk/Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp

    r109750 r114367  
    2525
    2626#include "config.h"
     27
     28#if ENABLE(CONTEXT_MENUS)
     29
    2730#include "WebPageContextMenuClient.h"
    2831
     
    9295
    9396} // namespace WebKit
     97#endif // ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/UIProcess/WebPageContextMenuClient.h

    r109750 r114367  
    2727#define WebPageContextMenuClient_h
    2828
     29#if ENABLE(CONTEXT_MENUS)
     30
    2931#include "APIClient.h"
    3032#include "WebHitTestResult.h"
     
    4749} // namespace WebKit
    4850
     51#endif // ENABLE(CONTEXT_MENUS)
    4952#endif // WebPageContextMenuClient_h
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r114286 r114367  
    298298}
    299299
     300#if ENABLE(CONTEXT_MENUS)
    300301void WebPageProxy::initializeContextMenuClient(const WKPageContextMenuClient* client)
    301302{
    302303    m_contextMenuClient.initialize(client);
    303304}
     305#endif
    304306
    305307void WebPageProxy::reattachToWebProcess()
     
    26962698}
    26972699
     2700#if ENABLE(CONTEXT_MENUS)
    26982701void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
    26992702{
     
    28052808    process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
    28062809}
     2810#endif // ENABLE(CONTEXT_MENUS)
    28072811
    28082812void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r114143 r114367  
    240240#endif
    241241
     242#if ENABLE(CONTEXT_MENUS)
    242243    void initializeContextMenuClient(const WKPageContextMenuClient*);
     244#endif
    243245    void initializeFindClient(const WKPageFindClient*);
    244246    void initializeFormClient(const WKPageFormClient*);
     
    567569    void preferencesDidChange();
    568570
     571#if ENABLE(CONTEXT_MENUS)
    569572    // Called by the WebContextMenuProxy.
    570573    void contextMenuItemSelected(const WebContextMenuItemData&);
     574#endif
    571575
    572576    // Called by the WebOpenPanelResultListenerProxy.
     
    792796#endif
    793797
     798#if ENABLE(CONTEXT_MENUS)
    794799    // Context Menu.
    795800    void showContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::ArgumentDecoder*);
    796801    void internalShowContextMenu(const WebCore::IntPoint& menuLocation, const WebHitTestResult::Data&, const Vector<WebContextMenuItemData>&, CoreIPC::ArgumentDecoder*);
     802#endif
    797803
    798804    // Search popup results
     
    893899    WebUIClient m_uiClient;
    894900    WebFindClient m_findClient;
     901#if ENABLE(CONTEXT_MENUS)
    895902    WebPageContextMenuClient m_contextMenuClient;
     903#endif
    896904
    897905    OwnPtr<DrawingAreaProxy> m_drawingArea;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r114143 r114367  
    197197#endif
    198198
     199#if ENABLE(CONTEXT_MENUS)
    199200    # ContextMenu messages
    200201    ShowContextMenu(WebCore::IntPoint menuLocation, WebKit::WebHitTestResult::Data hitTestResultData, Vector<WebKit::WebContextMenuItemData> items, WebKit::InjectedBundleUserMessageEncoder userData)
     202#endif
    201203
    202204    # Authentication messages
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

    r110397 r114367  
    5555void WKBundlePageSetContextMenuClient(WKBundlePageRef pageRef, WKBundlePageContextMenuClient* wkClient)
    5656{
     57#if ENABLE(CONTEXT_MENUS)
    5758    toImpl(pageRef)->initializeInjectedBundleContextMenuClient(wkClient);
     59#endif
    5860}
    5961
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp

    r95901 r114367  
    2525
    2626#include "config.h"
     27
     28#if ENABLE(CONTEXT_MENUS)
     29
    2730#include "InjectedBundlePageContextMenuClient.h"
    2831
     
    7679
    7780} // namespace WebKit
     81#endif // ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h

    r95901 r114367  
    2727#define InjectedBundlePageContextMenuClient_h
    2828
     29#if ENABLE(CONTEXT_MENUS)
     30
    2931#include "APIClient.h"
    3032#include "WKBundlePage.h"
     
    4951} // namespace WebKit
    5052
     53#endif // ENABLE(CONTEXT_MENUS)
    5154#endif // InjectedBundlePageEditorClient_h
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp

    r108957 r114367  
    2525
    2626#include "config.h"
     27
     28#if ENABLE(CONTEXT_MENUS)
     29
    2730#include "WebContextMenuClient.h"
    2831
     
    97100
    98101} // namespace WebKit
     102#endif // ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h

    r108957 r114367  
    2626#ifndef WebContextMenuClient_h
    2727#define WebContextMenuClient_h
     28
     29#if ENABLE(CONTEXT_MENUS)
    2830
    2931#include <WebCore/ContextMenuClient.h>
     
    7072} // namespace WebKit
    7173
     74#endif // ENABLE(CONTEXT_MENUS)
    7275#endif // WebContextMenuClient_h
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp

    r95901 r114367  
    2525
    2626#include "config.h"
     27
     28#if ENABLE(CONTEXT_MENUS)
     29
    2730#include "WebContextMenuClient.h"
    2831
     
    5558
    5659} // namespace WebKit
     60#endif // ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp

    r110348 r114367  
    2121
    2222#include "config.h"
     23
     24#if ENABLE(CONTEXT_MENUS)
     25
    2326#include "WebContextMenu.h"
    2427
     
    9497
    9598} // namespace WebKit
     99
     100#endif // ENABLE(CONTEXT_MENUS)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebContextMenu.h

    r95901 r114367  
    2121#ifndef WebContextMenu_h
    2222#define WebContextMenu_h
     23
     24#if ENABLE(CONTEXT_MENUS)
    2325
    2426#include "WebContextMenuItemData.h"
     
    5153} // namespace WebKit
    5254
     55#endif // ENABLE(CONTEXT_MENUS)
    5356#endif // WebPopupMenu_h
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r114249 r114367  
    216216    , m_numWheelEventHandlers(0)
    217217    , m_cachedPageCount(0)
     218#if ENABLE(CONTEXT_MENUS)
    218219    , m_isShowingContextMenu(false)
     220#endif
    219221    , m_willGoToBackForwardItemCallbackEnabled(true)
    220222#if PLATFORM(WIN)
     
    229231    Page::PageClients pageClients;
    230232    pageClients.chromeClient = new WebChromeClient(this);
     233#if ENABLE(CONTEXT_MENUS)
    231234    pageClients.contextMenuClient = new WebContextMenuClient(this);
     235#endif
    232236    pageClients.editorClient = new WebEditorClient(this);
    233237    pageClients.dragClient = new WebDragClient(this);
     
    328332}
    329333
     334#if ENABLE(CONTEXT_MENUS)
    330335void WebPage::initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient* client)
    331336{
    332337    m_contextMenuClient.initialize(client);
    333338}
     339#endif
    334340
    335341void WebPage::initializeInjectedBundleEditorClient(WKBundlePageEditorClient* client)
     
    11981204#endif
    11991205
     1206#if ENABLE(CONTEXT_MENUS)
    12001207WebContextMenu* WebPage::contextMenu()
    12011208{
     
    12041211    return m_contextMenu.get();
    12051212}
     1213#endif
    12061214
    12071215// Events
     
    12341242};
    12351243
     1244#if ENABLE(CONTEXT_MENUS)
    12361245static bool isContextClick(const PlatformMouseEvent& event)
    12371246{
     
    12631272    return handled;
    12641273}
     1274#endif
    12651275
    12661276static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, bool onlyUpdateScrollbars)
     
    12741284    switch (platformMouseEvent.type()) {
    12751285        case PlatformEvent::MousePressed: {
     1286#if ENABLE(CONTEXT_MENUS)
    12761287            if (isContextClick(platformMouseEvent))
    12771288                page->corePage()->contextMenuController()->clearContextMenu();
    1278            
     1289#endif
     1290
    12791291            bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent);
     1292#if ENABLE(CONTEXT_MENUS)
    12801293            if (isContextClick(platformMouseEvent))
    12811294                handled = handleContextMenuEvent(platformMouseEvent, page);
     1295#endif
    12821296
    12831297            return handled;
     
    12971311void WebPage::mouseEvent(const WebMouseEvent& mouseEvent)
    12981312{
     1313#if ENABLE(CONTEXT_MENUS)
    12991314    // Don't try to handle any pending mouse events if a context menu is showing.
    13001315    if (m_isShowingContextMenu) {
     
    13021317        return;
    13031318    }
     1319#endif
    13041320   
    13051321    bool handled = false;
     
    23942410#endif
    23952411
     2412#if ENABLE(CONTEXT_MENUS)
    23962413void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& item)
    23972414{
     
    24022419    m_contextMenu = 0;
    24032420}
     2421#endif
    24042422
    24052423void WebPage::replaceSelectionWithText(Frame* frame, const String& text)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r113974 r114367  
    3333#include "ImageOptions.h"
    3434#include "ImmutableArray.h"
     35#if ENABLE(CONTEXT_MENUS)
    3536#include "InjectedBundlePageContextMenuClient.h"
     37#endif
    3638#include "InjectedBundlePageEditorClient.h"
    3739#include "InjectedBundlePageFormClient.h"
     
    217219
    218220    // -- InjectedBundle methods
     221#if ENABLE(CONTEXT_MENUS)
    219222    void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*);
     223#endif
    220224    void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
    221225    void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
     
    228232#endif
    229233
     234#if ENABLE(CONTEXT_MENUS)
    230235    InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; }
     236#endif
    231237    InjectedBundlePageEditorClient& injectedBundleEditorClient() { return m_editorClient; }
    232238    InjectedBundlePageFormClient& injectedBundleFormClient() { return m_formClient; }
     
    348354#endif
    349355
     356#if ENABLE(CONTEXT_MENUS)
    350357    WebContextMenu* contextMenu();
     358#endif
    351359   
    352360    bool hasLocalDataForURL(const WebCore::KURL&);
     
    500508    String viewportConfigurationAsText(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
    501509
     510#if ENABLE(CONTEXT_MENUS)
    502511    void contextMenuShowing() { m_isShowingContextMenu = true; }
     512#endif
    503513
    504514#if PLATFORM(QT)
     
    580590#endif
    581591#endif
     592#if ENABLE(CONTEXT_MENUS)
    582593    void contextMenuHidden() { m_isShowingContextMenu = false; }
     594#endif
    583595
    584596    static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
     
    734746    WebCore::IntSize m_windowResizerSize;
    735747
     748#if ENABLE(CONTEXT_MENUS)
    736749    InjectedBundlePageContextMenuClient m_contextMenuClient;
     750#endif
    737751    InjectedBundlePageEditorClient m_editorClient;
    738752    InjectedBundlePageFormClient m_formClient;
     
    764778#endif
    765779    RefPtr<WebPopupMenu> m_activePopupMenu;
     780#if ENABLE(CONTEXT_MENUS)
    766781    RefPtr<WebContextMenu> m_contextMenu;
     782#endif
    767783    RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
    768784    RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
     
    795811    unsigned m_cachedPageCount;
    796812
     813#if ENABLE(CONTEXT_MENUS)
    797814    bool m_isShowingContextMenu;
     815#endif
    798816   
    799817    bool m_willGoToBackForwardItemCallbackEnabled;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

    r113181 r114367  
    4545#endif
    4646
     47#if ENABLE(CONTEXT_MENUS)
    4748    ContextMenuHidden()
     49#endif
    4850
    4951    ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
     
    158160#endif   
    159161   
     162#if ENABLE(CONTEXT_MENUS)
    160163    # Context menu.
    161164    DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem);
     165#endif
    162166
    163167    # Open panel.
Note: See TracChangeset for help on using the changeset viewer.