Source/WebCore/ChangeLog

 12012-04-05 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 NOBODY (OOPS!).
 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-05 Stephen Chenney <schenney@chromium.org>
213
314 REGRESSION(99539): Infinite repaint loop with SVGImage and deferred repaint timers

Source/WebCore/platform/ContextMenuItem.h

@@typedef struct _GtkAction GtkAction;
4444#elif PLATFORM(WX)
4545class wxMenuItem;
4646#endif
 47#endif // ENABLE(CONTEXT_MENUS)
4748
4849namespace WebCore {
4950

@@namespace WebCore {
175176 SubmenuType
176177 };
177178
 179#if ENABLE(CONTEXT_MENUS)
178180#if PLATFORM(MAC)
179181 typedef NSMenuItem* PlatformMenuItemDescription;
180182#elif PLATFORM(QT)

@@namespace WebCore {
303305#endif // USE(CROSS_PLATFORM_CONTEXT_MENUS)
304306 };
305307
 308#endif // ENABLE(CONTEXT_MENUS)
306309}
307310
308 #endif // ENABLE(CONTEXT_MENUS)
309311#endif // ContextMenuItem_h

Source/WebCore/platform/Widget.h

@@typedef QWebPageClient* PlatformPageClient;
9191#include "PageClientBlackBerry.h"
9292typedef PageClientBlackBerry* PlatformPageClient;
9393#elif PLATFORM(EFL)
94 namespace WebCore {
9594class PageClientEfl;
9695typedef PageClientEfl* PlatformPageClient;
97 }
9896#else
9997typedef PlatformWidget PlatformPageClient;
10098#endif

Source/WebKit/efl/ChangeLog

 12012-04-05 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 NOBODY (OOPS!).
 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-04 Raphael Kubo da Costa <rakuco@webkit.org>
221
322 Another unreviewed attempt at getting the EFL build bot to a

Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp

2323#include "ewk_private.h"
2424
2525namespace WebCore {
 26 class IntRect;
 27}
2628
2729PageClientEfl::PageClientEfl(Evas_Object* view)
2830 : m_view(view)

@@GraphicsContext3D* PageClientEfl::acceleratedCompositingContext()
4648}
4749#endif
4850
49 }

Source/WebKit/efl/WebCoreSupport/PageClientEfl.h

@@typedef struct _Evas_Native_Surface Evas_Native_Surface;
2626typedef struct _Evas_Object Evas_Object;
2727
2828namespace WebCore {
29 
3029class GraphicsContext3D;
 30} // namespace WebCore
3131
3232class PageClientEfl {
3333public:

@@protected:
4545 Evas_Object* m_view;
4646};
4747
48 } // namespace WebCore
49 
5048#endif // PageClientEfl_h

Source/WebKit/efl/ewk/ewk_private.h

@@namespace EWKPrivate {
9494WebCore::Frame *coreFrame(const Evas_Object *ewkFrame);
9595WebCore::Page *corePage(const Evas_Object *ewkView);
9696WebCore::HistoryItem *coreHistoryItem(const Ewk_History_Item *ewkHistoryItem);
97 WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView);
 97PlatformPageClient corePageClient(Evas_Object* ewkView);
9898
9999Evas_Object* kitFrame(const WebCore::Frame* coreFrame);
100100

Source/WebKit/efl/ewk/ewk_view.cpp

@@struct _Ewk_View_Private_Data {
151151 WebCore::Frame* mainFrame;
152152 WebCore::ViewportArguments viewportArguments;
153153 Ewk_History* history;
154  OwnPtr<WebCore::PageClientEfl> pageClient;
 154 OwnPtr<PageClientEfl> pageClient;
155155 struct {
156156 Ewk_Menu menu;
157157 WebCore::PopupMenuClient* menuClient;

@@static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
730730
731731 priv->soupSession = WebCore::ResourceHandle::defaultSession();
732732
733  priv->pageClient = adoptPtr(new WebCore::PageClientEfl(smartData->self));
 733 priv->pageClient = adoptPtr(new PageClientEfl(smartData->self));
734734
735735 return priv;
736736}

@@WebCore::Page *corePage(const Evas_Object *ewkView)
39633963 return priv->page.get();
39643964}
39653965
3966 WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView)
 3966PlatformPageClient corePageClient(Evas_Object* ewkView)
39673967{
39683968 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
39693969 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);

Source/WebKit2/ChangeLog

 12012-04-05 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 NOBODY (OOPS!).
 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-04 Hayato Ito <hayato@chromium.org>
257
358 Remove ReifiedTreeTraversal.

Source/WebKit2/Shared/API/c/WKContextMenuItem.cpp

@@using namespace WebKit;
3737
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}

Source/WebKit2/Shared/WebContextMenuItem.cpp

2424 */
2525
2626#include "config.h"
 27
 28#if ENABLE(CONTEXT_MENUS)
 29
2730#include "WebContextMenuItem.h"
2831
2932#include "ImmutableArray.h"

@@void WebContextMenuItem::setUserData(APIObject* userData)
8790
8891} // namespace WebKit
8992
 93#endif // ENABLE(CONTEXT_MENUS)

Source/WebKit2/Shared/WebContextMenuItem.h

2626#ifndef WebContextMenuItem_h
2727#define WebContextMenuItem_h
2828
 29#if ENABLE(CONTEXT_MENUS)
 30
2931#include "APIObject.h"
3032#include "WebContextMenuItemData.h"
3133

@@private:
6163
6264} // namespace WebKit
6365
 66#endif // ENABLE(CONTEXT_MENUS)
6467#endif // WebContextMenuItem_h

Source/WebKit2/Shared/WebContextMenuItemData.cpp

2424 */
2525
2626#include "config.h"
 27
 28#if ENABLE(CONTEXT_MENUS)
 29
2730#include "WebContextMenuItemData.h"
2831
2932#include "APIObject.h"

@@Vector<ContextMenuItem> coreItems(const Vector<WebContextMenuItemData>& kitItemV
156159}
157160
158161} // namespace WebKit
 162#endif // ENABLE(CONTEXT_MENUS)

Source/WebKit2/Shared/WebContextMenuItemData.h

2626#ifndef WebContextMenuItemData_h
2727#define WebContextMenuItemData_h
2828
 29#if ENABLE(CONTEXT_MENUS)
 30
2931#include <WebCore/ContextMenuItem.h>
3032#include <wtf/text/WTFString.h>
3133

@@Vector<WebCore::ContextMenuItem> coreItems(const Vector<WebContextMenuItemData>&
7981
8082} // namespace WebKit
8183
 84#endif // ENABLE(CONTEXT_MENUS)
8285#endif // WebContextMenuItemData_h

Source/WebKit2/UIProcess/API/C/WKPage.cpp

@@void WKPageCountStringMatches(WKPageRef pageRef, WKStringRef string, WKFindOptio
461461
462462void WKPageSetPageContextMenuClient(WKPageRef pageRef, const WKPageContextMenuClient* wkClient)
463463{
 464#if ENABLE(CONTEXT_MENUS)
464465 toImpl(pageRef)->initializeContextMenuClient(wkClient);
 466#endif
465467}
466468
467469void WKPageSetPageFindClient(WKPageRef pageRef, const WKPageFindClient* wkClient)

Source/WebKit2/UIProcess/WebPageContextMenuClient.cpp

2424 */
2525
2626#include "config.h"
 27
 28#if ENABLE(CONTEXT_MENUS)
 29
2730#include "WebPageContextMenuClient.h"
2831
2932#include "Logging.h"

@@void WebPageContextMenuClient::contextMenuDismissed(WebPageProxy* page)
9194}
9295
9396} // namespace WebKit
 97#endif // ENABLE(CONTEXT_MENUS)

Source/WebKit2/UIProcess/WebPageContextMenuClient.h

2626#ifndef WebPageContextMenuClient_h
2727#define WebPageContextMenuClient_h
2828
 29#if ENABLE(CONTEXT_MENUS)
 30
2931#include "APIClient.h"
3032#include "WebHitTestResult.h"
3133#include "WKPage.h"

@@public:
4648
4749} // namespace WebKit
4850
 51#endif // ENABLE(CONTEXT_MENUS)
4952#endif // WebPageContextMenuClient_h

Source/WebKit2/UIProcess/WebPageProxy.cpp

@@void WebPageProxy::initializeFindClient(const WKPageFindClient* client)
297297 m_findClient.initialize(client);
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()
306308{

@@void WebPageProxy::hidePopupMenu()
26892691 m_activePopupMenu = 0;
26902692}
26912693
 2694#if ENABLE(CONTEXT_MENUS)
26922695void WebPageProxy::showContextMenu(const IntPoint& menuLocation, const WebHitTestResult::Data& hitTestResultData, const Vector<WebContextMenuItemData>& proposedItems, CoreIPC::ArgumentDecoder* arguments)
26932696{
26942697 internalShowContextMenu(menuLocation, hitTestResultData, proposedItems, arguments);

@@void WebPageProxy::contextMenuItemSelected(const WebContextMenuItemData& item)
27982801
27992802 process()->send(Messages::WebPage::DidSelectItemFromActiveContextMenu(item), m_pageID);
28002803}
 2804#endif // ENABLE(CONTEXT_MENUS)
28012805
28022806void WebPageProxy::didChooseFilesForOpenPanel(const Vector<String>& fileURLs)
28032807{

Source/WebKit2/UIProcess/WebPageProxy.h

@@public:
239239 WebFullScreenManagerProxy* fullScreenManager();
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*);
245247 void initializeLoaderClient(const WKPageLoaderClient*);

@@public:
566568
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.
573577 void didChooseFilesForOpenPanel(const Vector<String>&);

@@private:
791795 void setPopupMenuSelectedIndex(int32_t);
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
799805 void saveRecentSearches(const String&, const Vector<String>&);

@@private:
892898 WebResourceLoadClient m_resourceLoadClient;
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;
898906 RefPtr<WebProcessProxy> m_process;

Source/WebKit2/UIProcess/WebPageProxy.messages.in

@@messages -> WebPageProxy {
196196 SetPopupMenuSelectedIndex(int32_t selectedIndex)
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
203205 CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate)

Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp

@@WKTypeID WKBundlePageGetTypeID()
5454
5555void WKBundlePageSetContextMenuClient(WKBundlePageRef pageRef, WKBundlePageContextMenuClient* wkClient)
5656{
 57#if ENABLE(CONTEXT_MENUS)
5758 toImpl(pageRef)->initializeInjectedBundleContextMenuClient(wkClient);
 59#endif
5860}
5961
6062void WKBundlePageSetEditorClient(WKBundlePageRef pageRef, WKBundlePageEditorClient* wkClient)

Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp

2424 */
2525
2626#include "config.h"
 27
 28#if ENABLE(CONTEXT_MENUS)
 29
2730#include "InjectedBundlePageContextMenuClient.h"
2831
2932#include "ImmutableArray.h"

@@bool InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems(WebPage*
7578}
7679
7780} // namespace WebKit
 81#endif // ENABLE(CONTEXT_MENUS)

Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h

2626#ifndef InjectedBundlePageContextMenuClient_h
2727#define InjectedBundlePageContextMenuClient_h
2828
 29#if ENABLE(CONTEXT_MENUS)
 30
2931#include "APIClient.h"
3032#include "WKBundlePage.h"
3133#include <wtf/Vector.h>

@@public:
4850
4951} // namespace WebKit
5052
 53#endif // ENABLE(CONTEXT_MENUS)
5154#endif // InjectedBundlePageEditorClient_h

Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp

2424 */
2525
2626#include "config.h"
 27
 28#if ENABLE(CONTEXT_MENUS)
 29
2730#include "WebContextMenuClient.h"
2831
2932#include "WebContextMenu.h"

@@void WebContextMenuClient::showContextMenu()
9699#endif
97100
98101} // namespace WebKit
 102#endif // ENABLE(CONTEXT_MENUS)

Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h

2626#ifndef WebContextMenuClient_h
2727#define WebContextMenuClient_h
2828
 29#if ENABLE(CONTEXT_MENUS)
 30
2931#include <WebCore/ContextMenuClient.h>
3032
3133namespace WebKit {

@@private:
6971
7072} // namespace WebKit
7173
 74#endif // ENABLE(CONTEXT_MENUS)
7275#endif // WebContextMenuClient_h

Source/WebKit2/WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp

2424 */
2525
2626#include "config.h"
 27
 28#if ENABLE(CONTEXT_MENUS)
 29
2730#include "WebContextMenuClient.h"
2831
2932#include <WebCore/NotImplemented.h>

@@void WebContextMenuClient::stopSpeaking()
5457}
5558
5659} // namespace WebKit
 60#endif // ENABLE(CONTEXT_MENUS)

Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp

2020 */
2121
2222#include "config.h"
 23
 24#if ENABLE(CONTEXT_MENUS)
 25
2326#include "WebContextMenu.h"
2427
2528#include "InjectedBundleHitTestResult.h"

@@void WebContextMenu::itemSelected(const WebContextMenuItemData& item)
9396}
9497
9598} // namespace WebKit
 99
 100#endif // ENABLE(CONTEXT_MENUS)

Source/WebKit2/WebProcess/WebPage/WebContextMenu.h

2121#ifndef WebContextMenu_h
2222#define WebContextMenu_h
2323
 24#if ENABLE(CONTEXT_MENUS)
 25
2426#include "WebContextMenuItemData.h"
2527
2628#include <wtf/PassRefPtr.h>

@@private:
5052
5153} // namespace WebKit
5254
 55#endif // ENABLE(CONTEXT_MENUS)
5356#endif // WebPopupMenu_h

Source/WebKit2/WebProcess/WebPage/WebPage.cpp

@@WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
214214 , m_canShortCircuitHorizontalWheelEvents(false)
215215 , m_numWheelEventHandlers(0)
216216 , m_cachedPageCount(0)
 217#if ENABLE(CONTEXT_MENUS)
217218 , m_isShowingContextMenu(false)
 219#endif
218220 , m_willGoToBackForwardItemCallbackEnabled(true)
219221#if PLATFORM(WIN)
220222 , m_gestureReachedScrollingLimit(false)

@@WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
227229
228230 Page::PageClients pageClients;
229231 pageClients.chromeClient = new WebChromeClient(this);
 232#if ENABLE(CONTEXT_MENUS)
230233 pageClients.contextMenuClient = new WebContextMenuClient(this);
 234#endif
231235 pageClients.editorClient = new WebEditorClient(this);
232236 pageClients.dragClient = new WebDragClient(this);
233237 pageClients.backForwardClient = WebBackForwardListProxy::create(this);

@@CoreIPC::Connection* WebPage::connection() const
323327 return WebProcess::shared().connection();
324328}
325329
 330#if ENABLE(CONTEXT_MENUS)
326331void WebPage::initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient* client)
327332{
328333 m_contextMenuClient.initialize(client);
329334}
 335#endif
330336
331337void WebPage::initializeInjectedBundleEditorClient(WKBundlePageEditorClient* client)
332338{

@@void WebPage::pageDidRequestScroll(const IntPoint& point)
11771183}
11781184#endif
11791185
 1186#if ENABLE(CONTEXT_MENUS)
11801187WebContextMenu* WebPage::contextMenu()
11811188{
11821189 if (!m_contextMenu)
11831190 m_contextMenu = WebContextMenu::create(this);
11841191 return m_contextMenu.get();
11851192}
 1193#endif
11861194
11871195// Events
11881196

@@private:
12131221 const WebEvent* m_previousCurrentEvent;
12141222};
12151223
 1224#if ENABLE(CONTEXT_MENUS)
12161225static bool isContextClick(const PlatformMouseEvent& event)
12171226{
12181227 if (event.button() == WebCore::RightButton)

@@static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent,
12421251
12431252 return handled;
12441253}
 1254#endif
12451255
12461256static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, bool onlyUpdateScrollbars)
12471257{

@@static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, boo
12531263
12541264 switch (platformMouseEvent.type()) {
12551265 case PlatformEvent::MousePressed: {
 1266#if ENABLE(CONTEXT_MENUS)
12561267 if (isContextClick(platformMouseEvent))
12571268 page->corePage()->contextMenuController()->clearContextMenu();
1258 
 1269#endif
 1270
12591271 bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent);
 1272#if ENABLE(CONTEXT_MENUS)
12601273 if (isContextClick(platformMouseEvent))
12611274 handled = handleContextMenuEvent(platformMouseEvent, page);
 1275#endif
12621276
12631277 return handled;
12641278 }

@@static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, boo
12761290
12771291void WebPage::mouseEvent(const WebMouseEvent& mouseEvent)
12781292{
 1293#if ENABLE(CONTEXT_MENUS)
12791294 // Don't try to handle any pending mouse events if a context menu is showing.
12801295 if (m_isShowingContextMenu) {
12811296 send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), false));
12821297 return;
12831298 }
 1299#endif
12841300
12851301 bool handled = false;
12861302

@@void WebPage::failedToShowPopupMenu()
23682384}
23692385#endif
23702386
 2387#if ENABLE(CONTEXT_MENUS)
23712388void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& item)
23722389{
23732390 if (!m_contextMenu)

@@void WebPage::didSelectItemFromActiveContextMenu(const WebContextMenuItemData& i
23762393 m_contextMenu->itemSelected(item);
23772394 m_contextMenu = 0;
23782395}
 2396#endif
23792397
23802398void WebPage::replaceSelectionWithText(Frame* frame, const String& text)
23812399{

Source/WebKit2/WebProcess/WebPage/WebPage.h

3232#include "GeolocationPermissionRequestManager.h"
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"
3840#include "InjectedBundlePageFullScreenClient.h"

@@public:
216218 void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, OwnPtr<CoreIPC::ArgumentEncoder>&);
217219
218220 // -- InjectedBundle methods
 221#if ENABLE(CONTEXT_MENUS)
219222 void initializeInjectedBundleContextMenuClient(WKBundlePageContextMenuClient*);
 223#endif
220224 void initializeInjectedBundleEditorClient(WKBundlePageEditorClient*);
221225 void initializeInjectedBundleFormClient(WKBundlePageFormClient*);
222226 void initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient*);

@@public:
227231 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*);
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; }
233239 InjectedBundlePageLoaderClient& injectedBundleLoaderClient() { return m_loaderClient; }

@@public:
346352 WebCore::IntSize viewportSize() const { return m_viewportSize; }
347353#endif
348354
 355#if ENABLE(CONTEXT_MENUS)
349356 WebContextMenu* contextMenu();
 357#endif
350358
351359 bool hasLocalDataForURL(const WebCore::KURL&);
352360 String cachedResponseMIMETypeForURL(const WebCore::KURL&);

@@public:
498506 void simulateMouseMotion(WebCore::IntPoint, double time);
499507 String viewportConfigurationAsText(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight);
500508
 509#if ENABLE(CONTEXT_MENUS)
501510 void contextMenuShowing() { m_isShowingContextMenu = true; }
 511#endif
502512
503513#if PLATFORM(QT)
504514 void registerApplicationScheme(const String& scheme);

@@private:
578588 void highlightPotentialActivation(const WebCore::IntPoint&, const WebCore::IntSize& area);
579589#endif
580590#endif
 591#if ENABLE(CONTEXT_MENUS)
581592 void contextMenuHidden() { m_isShowingContextMenu = false; }
 593#endif
582594
583595 static void scroll(WebCore::Page*, WebCore::ScrollDirection, WebCore::ScrollGranularity);
584596 static void logicalScroll(WebCore::Page*, WebCore::ScrollLogicalDirection, WebCore::ScrollGranularity);

@@private:
732744
733745 WebCore::IntSize m_windowResizerSize;
734746
 747#if ENABLE(CONTEXT_MENUS)
735748 InjectedBundlePageContextMenuClient m_contextMenuClient;
 749#endif
736750 InjectedBundlePageEditorClient m_editorClient;
737751 InjectedBundlePageFormClient m_formClient;
738752 InjectedBundlePageLoaderClient m_loaderClient;

@@private:
762776 RefPtr<WebFullScreenManager> m_fullScreenManager;
763777#endif
764778 RefPtr<WebPopupMenu> m_activePopupMenu;
 779#if ENABLE(CONTEXT_MENUS)
765780 RefPtr<WebContextMenu> m_contextMenu;
 781#endif
766782 RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
767783 RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
768784

@@private:
793809
794810 unsigned m_cachedPageCount;
795811
 812#if ENABLE(CONTEXT_MENUS)
796813 bool m_isShowingContextMenu;
 814#endif
797815
798816 bool m_willGoToBackForwardItemCallbackEnabled;
799817

Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

@@messages -> WebPage {
4444 HighlightPotentialActivation(WebCore::IntPoint point, WebCore::IntSize area)
4545#endif
4646
 47#if ENABLE(CONTEXT_MENUS)
4748 ContextMenuHidden()
 49#endif
4850
4951 ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
5052 CenterSelectionInVisibleArea()

@@messages -> WebPage {
157159 FailedToShowPopupMenu();
158160#endif
159161
 162#if ENABLE(CONTEXT_MENUS)
160163 # Context menu.
161164 DidSelectItemFromActiveContextMenu(WebKit::WebContextMenuItemData menuItem);
 165#endif
162166
163167 # Open panel.
164168 DidChooseFilesForOpenPanel(Vector<WTF::String> fileURLs)