https://bugs.webkit.org/show_bug.cgi?id=79427
Patch by Hajime Morrita <morrita@chromium.org> on 2012-02-26
Reviewed by Adam Barth.
Source/JavaScriptCore:
Added ACCESSIBILITY_CONTEXT_MENUS.
* wtf/Platform.h:
Source/WebCore:
- Removed ChromeClient::showContextMenu(), Chrome::showContextMenu()
- Added ContextMenuController::showContextMenuAt(), ContextMenuClient::showContextMenu()
- Hided showContextMenu() behind ACCESSIBILITY_CONTEXT_MENUS
This change localizes context menu related code and will make it easy to
modularize CONTEXT_MENUS code.
Refactoring. No new tests.
* WebCore.exp.in:
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
* loader/EmptyClients.h:
(EmptyContextMenuClient):
(WebCore::EmptyContextMenuClient::showContextMenu):
* page/ContextMenuClient.h:
(ContextMenuClient):
* page/ContextMenuController.cpp:
(WebCore):
(WebCore::ContextMenuController::showContextMenuAt):
* page/ContextMenuController.h:
(ContextMenuController):
* page/Chrome.cpp:
* page/Chrome.h:
(Chrome):
* page/ChromeClient.h:
(ChromeClient):
Source/WebKit/blackberry:
* WebCoreSupport/ChromeClientBlackBerry.h:
(ChromeClientBlackBerry):
Source/WebKit/chromium:
* src/ChromeClientImpl.h:
(ChromeClientImpl):
Source/WebKit/efl:
* WebCoreSupport/ChromeClientEfl.h:
(ChromeClientEfl):
Source/WebKit/gtk:
* WebCoreSupport/ChromeClientGtk.h:
(ChromeClient):
Source/WebKit/mac:
* WebCoreSupport/WebContextMenuClient.h:
(WebContextMenuClient):
* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::showContextMenu): Moved from WebChromeClient
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
Source/WebKit/qt:
* WebCoreSupport/ChromeClientQt.h:
(ChromeClientQt):
Source/WebKit/win:
* WebCoreSupport/WebChromeClient.h:
(WebChromeClient):
Source/WebKit/wince:
* WebCoreSupport/ChromeClientWinCE.h:
(ChromeClientWinCE):
Source/WebKit/wx:
* WebKitSupport/ChromeClientWx.h:
(ChromeClientWx):
Source/WebKit2:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
(WebChromeClient):
* WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
(WebKit):
(WebKit::WebContextMenuClient::showContextMenu): Moved from WebChromeClient
* WebProcess/WebCoreSupport/WebContextMenuClient.h:
(WebContextMenuClient):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleContextMenuEvent):
(WebKit::handleMouseEvent):
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::mouseEventSyncForTesting):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108957
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ Added ACCESSIBILITY_CONTEXT_MENUS.
+
+ * wtf/Platform.h:
+
2012-02-26 Filip Pizlo <fpizlo@apple.com>
LayoutTests/fast/xpath/xpath-functional-test.html is crashing in the DFG
#define WTF_USE_CROSS_PLATFORM_CONTEXT_MENUS 1
#endif
+#if PLATFORM(MAC) && HAVE(ACCESSIBILITY)
+#define WTF_USE_ACCESSIBILITY_CONTEXT_MENUS 1
+#endif
+
/* Geolocation request policy. pre-emptive policy is to acquire user permission before acquiring location.
Client based implementations will have option to choose between pre-emptive and nonpre-emptive permission policy.
pre-emptive permission policy is enabled by default for all client-based implementations. */
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ - Removed ChromeClient::showContextMenu(), Chrome::showContextMenu()
+ - Added ContextMenuController::showContextMenuAt(), ContextMenuClient::showContextMenu()
+ - Hided showContextMenu() behind ACCESSIBILITY_CONTEXT_MENUS
+
+ This change localizes context menu related code and will make it easy to
+ modularize CONTEXT_MENUS code.
+
+ Refactoring. No new tests.
+
+ * WebCore.exp.in:
+ * accessibility/mac/WebAccessibilityObjectWrapper.mm:
+ (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
+ * loader/EmptyClients.h:
+ (EmptyContextMenuClient):
+ (WebCore::EmptyContextMenuClient::showContextMenu):
+ * page/ContextMenuClient.h:
+ (ContextMenuClient):
+ * page/ContextMenuController.cpp:
+ (WebCore):
+ (WebCore::ContextMenuController::showContextMenuAt):
+ * page/ContextMenuController.h:
+ (ContextMenuController):
+ * page/Chrome.cpp:
+ * page/Chrome.h:
+ (Chrome):
+ * page/ChromeClient.h:
+ (ChromeClient):
+
2012-02-26 Benjamin Poulain <bpoulain@apple.com>
[Mac] Release localized Strings instead of AutoRelease
__ZN7WebCore21ContextMenuController23contextMenuItemSelectedEPNS_15ContextMenuItemE
__ZN7WebCore21contextMenuItemVectorEP14NSMutableArray
__ZN7WebCore23platformMenuDescriptionERN3WTF6VectorINS_15ContextMenuItemELm0EEE
-__ZN7WebCore6Chrome15showContextMenuEv
__ZNK7WebCore11ContextMenu19platformDescriptionEv
__ZNK7WebCore15ContextMenuItem15platformSubMenuEv
__ZNK7WebCore15ContextMenuItem4typeEv
#import "AccessibilityTableRow.h"
#import "Chrome.h"
#import "ColorMac.h"
+#import "ContextMenuController.h"
#import "Frame.h"
#import "FrameLoaderClient.h"
#import "FrameSelection.h"
Page* page = frame->page();
if (!page)
return;
-
- // Simulate a click in the middle of the object.
- IntPoint clickPoint = m_object->clickPoint();
-
- PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
- bool handled = frame->eventHandler()->sendContextMenuEvent(mouseEvent);
- if (handled)
- page->chrome()->showContextMenu();
+ page->contextMenuController()->showContextMenuAt(frame, m_object->clickPoint());
}
- (void)accessibilityPerformAction:(NSString*)action
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const { return adoptRef(new EmptyPopupMenu()); }
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const { return adoptRef(new EmptySearchPopupMenu()); }
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
-
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
virtual void registerProtocolHandler(const String&, const String&, const String&, const String&) { }
#endif
#if PLATFORM(MAC)
virtual void searchWithSpotlight() { }
#endif
+
+#if USE(ACCESSIBILITY_CONTEXT_MENUS)
+ virtual void showContextMenu() { }
+#endif
};
#endif // ENABLE(CONTEXT_MENUS)
return m_client->createSearchPopupMenu(client);
}
-#if ENABLE(CONTEXT_MENUS)
-void Chrome::showContextMenu()
-{
- m_client->showContextMenu();
-}
-#endif
-
bool Chrome::requiresFullscreenForVideoPlayback()
{
return m_client->requiresFullscreenForVideoPlayback();
PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
-#if ENABLE(CONTEXT_MENUS)
- void showContextMenu();
-#endif
-
private:
Chrome(Page*, ChromeClient*);
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const = 0;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const = 0;
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() = 0;
-#endif
-
virtual void postAccessibilityNotification(AccessibilityObject*, AXObjectCache::AXNotification) { }
virtual void notifyScrollerThumbIsVisibleInRect(const IntRect&) { }
#if PLATFORM(MAC)
virtual void searchWithSpotlight() = 0;
#endif
+
+#if USE(ACCESSIBILITY_CONTEXT_MENUS)
+ virtual void showContextMenu() = 0;
+#endif
};
}
#include "NavigationAction.h"
#include "Node.h"
#include "Page.h"
+#include "PlatformEvent.h"
#include "RenderLayer.h"
#include "RenderObject.h"
#include "ReplaceSelectionCommand.h"
item.setEnabled(shouldEnable);
}
+#if USE(ACCESSIBILITY_CONTEXT_MENUS)
+void ContextMenuController::showContextMenuAt(Frame* frame, const IntPoint& clickPoint)
+{
+ // Simulate a click in the middle of the accessibility object.
+ PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
+ bool handled = frame->eventHandler()->sendContextMenuEvent(mouseEvent);
+ if (handled && client())
+ client()->showContextMenu();
+}
+#endif
+
} // namespace WebCore
#endif // ENABLE(CONTEXT_MENUS)
void setHitTestResult(const HitTestResult& result) { m_hitTestResult = result; }
const HitTestResult& hitTestResult() { return m_hitTestResult; }
+#if USE(ACCESSIBILITY_CONTEXT_MENUS)
+ void showContextMenuAt(Frame*, const IntPoint& clickPoint);
+#endif
+
private:
ContextMenuController(Page*, ContextMenuClient*);
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebCoreSupport/ChromeClientBlackBerry.h:
+ (ChromeClientBlackBerry):
+
2012-02-24 Mike Fenton <mifenton@rim.com>
[BlackBerry] Eliminate excessive BlackBerry::Platform use in InputHandler
virtual bool selectItemAlignmentFollowsMenuWritingDirection();
virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const;
virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const;
- virtual void showContextMenu() { }
#if USE(ACCELERATED_COMPOSITING)
virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*);
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * src/ChromeClientImpl.h:
+ (ChromeClientImpl):
+
2012-02-26 James Robinson <jamesr@chromium.org>
Take 2 build fix.
virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const;
virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
-
virtual bool shouldRunModalDialogDuringPageDismissal(const DialogType&, const String& dialogMessage, WebCore::FrameLoader::PageDismissalType) const;
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const;
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebCoreSupport/ChromeClientEfl.h:
+ (ChromeClientEfl):
+
2012-02-24 Grzegorz Czajkowski <g.czajkowski@samsung.com>
[EFL][DRT] Implement setValueForUser and setAutofilled.
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t totalSpaceNeeded);
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
-
#if ENABLE(TOUCH_EVENTS)
virtual void needTouchEvents(bool);
#endif
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebCoreSupport/ChromeClientGtk.h:
+ (ChromeClient):
+
2012-02-24 Shinya Kawanaka <shinyak@chromium.org>
SpellCheckRequest needs to know the context where the spellcheck happened.
#endif
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t totalSpaceNeeded);
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
virtual void loadIconForFiles(const Vector<WTF::String>&, FileIconLoader*);
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebCoreSupport/WebContextMenuClient.h:
+ (WebContextMenuClient):
+ * WebCoreSupport/WebContextMenuClient.mm:
+ (WebContextMenuClient::showContextMenu): Moved from WebChromeClient
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+
2012-02-25 Sam Weinig <sam@webkit.org>
QuickLook events don't make it to WebKit plugins.
virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const OVERRIDE;
virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const OVERRIDE;
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() OVERRIDE;
-#endif
-
virtual void numWheelEventHandlersChanged(unsigned) OVERRIDE { }
virtual void numTouchEventHandlersChanged(unsigned) OVERRIDE { }
virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const OVERRIDE { return false; }
return adoptRef(new SearchPopupMenuMac(client));
}
-#if ENABLE(CONTEXT_MENUS)
-void WebChromeClient::showContextMenu()
-{
- Page* page = [m_webView page];
- if (!page)
- return;
-
- ContextMenuController* controller = page->contextMenuController();
- Node* node = controller->hitTestResult().innerNonSharedNode();
- if (!node)
- return;
- Frame* frame = node->document()->frame();
- if (!frame)
- return;
- FrameView* frameView = frame->view();
- if (!frameView)
- return;
- NSView* view = frameView->documentView();
-
- IntPoint point = frameView->contentsToWindow(controller->hitTestResult().point());
- NSPoint nsScreenPoint = [view convertPoint:point toView:nil];
- // Show the contextual menu for this event.
- NSEvent* event = [NSEvent mouseEventWithType:NSRightMouseDown location:nsScreenPoint modifierFlags:0 timestamp:0 windowNumber:[[view window] windowNumber] context:0 eventNumber:0 clickCount:1 pressure:1];
- NSMenu* nsMenu = [view menuForEvent:event];
- if (nsMenu)
- [NSMenu popUpContextMenu:nsMenu withEvent:event forView:view];
-}
-#endif
-
#if USE(ACCELERATED_COMPOSITING)
void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
virtual void speak(const WTF::String&) OVERRIDE;
virtual void stopSpeaking() OVERRIDE;
virtual void searchWithSpotlight() OVERRIDE;
+ virtual void showContextMenu() OVERRIDE;
WebView *webView() { return m_webView; }
#import "WebViewInternal.h"
#import <WebCore/ContextMenu.h>
#import <WebCore/ContextMenuController.h>
+#import <WebCore/Document.h>
#import <WebCore/KURL.h>
#import <WebCore/LocalizedStrings.h>
#import <WebCore/Page.h>
+#import <WebCore/Frame.h>
+#import <WebCore/FrameView.h>
#import <WebCore/RuntimeApplicationChecks.h>
#import <WebKit/DOMPrivate.h>
{
[NSApp stopSpeaking:nil];
}
+
+void WebContextMenuClient::showContextMenu()
+{
+ Page* page = [m_webView page];
+ if (!page)
+ return;
+ ContextMenuController* controller = page->contextMenuController();
+ Node* node = controller->hitTestResult().innerNonSharedNode();
+ if (!node)
+ return;
+ Frame* frame = node->document()->frame();
+ if (!frame)
+ return;
+ FrameView* frameView = frame->view();
+ if (!frameView)
+ return;
+
+ IntPoint point = frameView->contentsToWindow(controller->hitTestResult().point());
+ NSView* view = frameView->documentView();
+ NSPoint nsScreenPoint = [view convertPoint:point toView:nil];
+ // Show the contextual menu for this event.
+ NSEvent* event = [NSEvent mouseEventWithType:NSRightMouseDown location:nsScreenPoint modifierFlags:0 timestamp:0 windowNumber:[[view window] windowNumber] context:0 eventNumber:0 clickCount:1 pressure:1];
+ NSMenu* nsMenu = [view menuForEvent:event];
+ if (nsMenu)
+ [NSMenu popUpContextMenu:nsMenu withEvent:event forView:view];
+}
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebCoreSupport/ChromeClientQt.h:
+ (ChromeClientQt):
+
2012-02-24 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
[Qt] API: Unify the loading properties and signals.
#endif
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t totalSpaceNeeded);
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
#if USE(ACCELERATED_COMPOSITING)
// This is a hook for WebCore to tell us what we need to do with the GraphicsLayers.
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebCoreSupport/WebChromeClient.h:
+ (WebChromeClient):
+
2012-02-24 Shinya Kawanaka <shinyak@chromium.org>
SpellCheckRequest needs to know the context where the spellcheck happened.
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
-
virtual void populateVisitedLinks();
virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebCoreSupport/ChromeClientWinCE.h:
+ (ChromeClientWinCE):
+
2012-02-24 Shinya Kawanaka <shinyak@chromium.org>
SpellCheckRequest needs to know the context where the spellcheck happened.
// for this origin.
virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
-
#if ENABLE(NOTIFICATIONS)
virtual WebCore::NotificationPresenter* notificationPresenter() const;
#endif
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebKitSupport/ChromeClientWx.h:
+ (ChromeClientWx):
+
2012-02-24 Shinya Kawanaka <shinyak@chromium.org>
SpellCheckRequest needs to know the context where the spellcheck happened.
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t totalSpaceNeeded);
-
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() { }
-#endif
-
virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>);
virtual void loadIconForFiles(const Vector<String>&, FileIconLoader*);
+2012-02-26 Hajime Morrita <morrita@chromium.org>
+
+ Move ChromeClient::showContextMenu() to ContextMenuClient
+ https://bugs.webkit.org/show_bug.cgi?id=79427
+
+ Reviewed by Adam Barth.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ (WebChromeClient):
+ * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
+ (WebKit):
+ (WebKit::WebContextMenuClient::showContextMenu): Moved from WebChromeClient
+ * WebProcess/WebCoreSupport/WebContextMenuClient.h:
+ (WebContextMenuClient):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::handleContextMenuEvent):
+ (WebKit::handleMouseEvent):
+ (WebKit::WebPage::mouseEvent):
+ (WebKit::WebPage::mouseEventSyncForTesting):
+
2012-02-26 Huang Dongsung <luxtella@company100.net>
Use Functional instead of a MessageQueue for messages to the LayerTreeHostProxy
#include "DrawingArea.h"
#include "InjectedBundleNavigationAction.h"
#include "InjectedBundleUserMessageCoders.h"
-#include "WebContextMenu.h"
#include "WebCoreArgumentCoders.h"
#include "WebFrame.h"
#include "WebFrameLoaderClient.h"
return WebSearchPopupMenu::create(m_page, client);
}
-#if ENABLE(CONTEXT_MENUS)
-void WebChromeClient::showContextMenu()
-{
- m_page->contextMenu()->show();
-}
-#endif
-
#if USE(ACCELERATED_COMPOSITING)
void WebChromeClient::attachRootGraphicsLayer(Frame*, GraphicsLayer* layer)
{
virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const OVERRIDE;
virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const OVERRIDE;
-#if ENABLE(CONTEXT_MENUS)
- virtual void showContextMenu() OVERRIDE;
-#endif
-
#if USE(ACCELERATED_COMPOSITING)
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) OVERRIDE;
virtual void setNeedsOneShotDrawingSynchronization() OVERRIDE;
#include "config.h"
#include "WebContextMenuClient.h"
+#include "WebContextMenu.h"
#include "WebContextMenuItemData.h"
#include "WebPage.h"
#include <WebCore/ContextMenu.h>
}
}
+#if USE(ACCESSIBILITY_CONTEXT_MENUS)
+void WebContextMenuClient::showContextMenu()
+{
+ m_page->contextMenu()->show();
+}
+#endif
+
} // namespace WebKit
#if PLATFORM(MAC)
virtual void searchWithSpotlight() OVERRIDE;
#endif
-
+
+#if USE(ACCESSIBILITY_CONTEXT_MENUS)
+ void showContextMenu() OVERRIDE;
+#endif
+
WebPage* m_page;
};
return false;
}
-static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, Page* page)
+static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, WebPage* page)
{
- IntPoint point = page->mainFrame()->view()->windowToContents(platformMouseEvent.position());
- HitTestResult result = page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false);
+ IntPoint point = page->corePage()->mainFrame()->view()->windowToContents(platformMouseEvent.position());
+ HitTestResult result = page->corePage()->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false);
- Frame* frame = page->mainFrame();
+ Frame* frame = page->corePage()->mainFrame();
if (result.innerNonSharedNode())
frame = result.innerNonSharedNode()->document()->frame();
bool handled = frame->eventHandler()->sendContextMenuEvent(platformMouseEvent);
if (handled)
- page->chrome()->showContextMenu();
+ page->contextMenu()->show();
return handled;
}
-static bool handleMouseEvent(const WebMouseEvent& mouseEvent, Page* page, bool onlyUpdateScrollbars)
+static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, bool onlyUpdateScrollbars)
{
- Frame* frame = page->mainFrame();
+ Frame* frame = page->corePage()->mainFrame();
if (!frame->view())
return false;
switch (platformMouseEvent.type()) {
case PlatformEvent::MousePressed: {
if (isContextClick(platformMouseEvent))
- page->contextMenuController()->clearContextMenu();
+ page->corePage()->contextMenuController()->clearContextMenu();
bool handled = frame->eventHandler()->handleMousePressEvent(platformMouseEvent);
if (isContextClick(platformMouseEvent))
// of those cases where the page is not active and the mouse is not pressed, then we can fire a more
// efficient scrollbars-only version of the event.
bool onlyUpdateScrollbars = !(m_page->focusController()->isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
- handled = handleMouseEvent(mouseEvent, m_page.get(), onlyUpdateScrollbars);
+ handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
}
send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), handled));
// of those cases where the page is not active and the mouse is not pressed, then we can fire a more
// efficient scrollbars-only version of the event.
bool onlyUpdateScrollbars = !(m_page->focusController()->isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
- handled = handleMouseEvent(mouseEvent, m_page.get(), onlyUpdateScrollbars);
+ handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
}
}