<https://webkit.org/b/119957> Page::contextMenuController() should return a reference.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Aug 2013 19:46:45 +0000 (19:46 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Aug 2013 19:46:45 +0000 (19:46 +0000)
Reviewed by Antti Koivisto.

Page::m_contextMenuController is never null.

* page/Page.h:
(WebCore::Page::contextMenuController):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154239 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/dom/Node.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/page/Page.h
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
Source/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/WebProcess/WebPage/WebContextMenu.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 7b63009963070c8890cddab5fe43db36996fc382..1c6a8b212ef18166ed72d1d5deac7a9c91bc783d 100644 (file)
@@ -1,3 +1,14 @@
+2013-08-17  Andreas Kling  <akling@apple.com>
+
+        <https://webkit.org/b/119957> Page::contextMenuController() should return a reference.
+
+        Reviewed by Antti Koivisto.
+
+        Page::m_contextMenuController is never null.
+
+        * page/Page.h:
+        (WebCore::Page::contextMenuController):
+
 2013-08-17  Andreas Kling  <akling@apple.com>
 
         <https://webkit.org/b/119954> Page::dragCaretController() should return a reference.
index a418c6f87a90fdb2948d57e483940a8b8cb82d78..5fc81b17fa934e84ff2777915e63ba62ec8807c8 100644 (file)
@@ -3019,7 +3019,7 @@ static NSString* roleValueToNSString(AccessibilityRole value)
         }
     }
     
-    page->contextMenuController()->showContextMenuAt(page->mainFrame(), rect.center());
+    page->contextMenuController().showContextMenuAt(page->mainFrame(), rect.center());
 }
 
 - (void)accessibilityScrollToVisible
index 565ea7e781d90f70d46bd60236684bd78ff5803b..57f3d69ed482f6a0f32134c59f16a7342e7d71b0 100644 (file)
@@ -2213,7 +2213,7 @@ void Node::defaultEventHandler(Event* event)
     } else if (eventType == eventNames().contextmenuEvent) {
         if (Frame* frame = document()->frame())
             if (Page* page = frame->page())
-                page->contextMenuController()->handleContextMenuEvent(event);
+                page->contextMenuController().handleContextMenuEvent(event);
 #endif
     } else if (eventType == eventNames().textInputEvent) {
         if (event->hasInterface(eventNames().interfaceForTextEvent))
index bcce55836e539814ce1ffb5971e3e12fd7039b24..52463d08ff76bcc57afce34a0887d23222232a83 100644 (file)
@@ -276,8 +276,7 @@ void InspectorFrontendHost::showContextMenu(Event* event, const Vector<ContextMe
         return;
     }
     RefPtr<FrontendMenuProvider> menuProvider = FrontendMenuProvider::create(this, frontendApiObject, items);
-    ContextMenuController* menuController = m_frontendPage->contextMenuController();
-    menuController->showContextMenu(event, menuProvider);
+    m_frontendPage->contextMenuController().showContextMenu(event, menuProvider);
     m_menuProvider = menuProvider.get();
 }
 #endif
index bed80b5ee300f0db986af0a752ab4647afc5cbf1..d2172556458f07fd37058a24312a25a29d97d87d 100644 (file)
@@ -191,7 +191,7 @@ public:
 #endif
     FocusController& focusController() const { return *m_focusController; }
 #if ENABLE(CONTEXT_MENUS)
-    ContextMenuController* contextMenuController() const { return m_contextMenuController.get(); }
+    ContextMenuController& contextMenuController() const { return *m_contextMenuController; }
 #endif
 #if ENABLE(INSPECTOR)
     InspectorController* inspectorController() const { return m_inspectorController.get(); }
@@ -447,7 +447,7 @@ private:
 #endif
     const OwnPtr<FocusController> m_focusController;
 #if ENABLE(CONTEXT_MENUS)
-    OwnPtr<ContextMenuController> m_contextMenuController;
+    const OwnPtr<ContextMenuController> m_contextMenuController;
 #endif
 #if ENABLE(INSPECTOR)
     OwnPtr<InspectorController> m_inspectorController;
index 92e72b53ffa219aaac828bdafe06c8e991e41613..03de9bba1eb017ff6164339bc2992394a063c12b 100644 (file)
@@ -1600,7 +1600,7 @@ Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* ewkView, const Evas_E
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
     Eina_Bool mouse_press_handled = false;
 
-    priv->page->contextMenuController()->clearContextMenu();
+    priv->page->contextMenuController().clearContextMenu();
     if (priv->contextMenu)
         ewk_context_menu_free(priv->contextMenu);
 
@@ -1619,14 +1619,14 @@ Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* ewkView, const Evas_E
         return false;
 
     WebCore::ContextMenu* coreMenu =
-        priv->page->contextMenuController()->contextMenu();
+        priv->page->contextMenuController().contextMenu();
     if (!coreMenu) {
         // WebCore decided not to create a context menu, return true if event
         // was handled by handleMouseReleaseEvent
         return mouse_press_handled;
     }
 
-    priv->contextMenu = ewk_context_menu_new(ewkView, priv->page->contextMenuController(), coreMenu);
+    priv->contextMenu = ewk_context_menu_new(ewkView, &priv->page->contextMenuController(), coreMenu);
     if (!priv->contextMenu)
         return false;
 
index e0c3ed9d1258f30fde9508d8f176df267ecc6483..4170f77ff52b171950a51cf1556b1c9921b7fe29 100644 (file)
@@ -95,7 +95,7 @@ PlatformMenuDescription ContextMenuClient::getCustomMenuFromDefaultItems(Context
     GtkMenu* gtkmenu = menu->releasePlatformDescription();
 
     WebKitWebView* webView = m_webView;
-    HitTestResult result = core(webView)->contextMenuController()->hitTestResult();
+    HitTestResult result = core(webView)->contextMenuController().hitTestResult();
 
     if (result.isContentEditable()) {
         GtkWidget* imContextMenu = inputMethodsMenuItem(webView);
index 5697f71a1d77a269423bb8b767c55d612db2dbaf..6b00af89fd256482d1bcc4ffc6404d24a6925c36 100644 (file)
@@ -345,7 +345,7 @@ static bool defaultContextMenuEnabled(WebKitWebView* webView)
 static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webView, const PlatformMouseEvent& event, bool triggeredWithKeyboard)
 {
     Page* page = core(webView);
-    page->contextMenuController()->clearContextMenu();
+    page->contextMenuController().clearContextMenu();
     Frame* focusedFrame;
     Frame* mainFrame = page->mainFrame();
     gboolean mousePressEventResult = FALSE;
@@ -381,8 +381,7 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie
     // If coreMenu is NULL, this means WebCore decided to not create
     // the default context menu; this may happen when the page is
     // handling the right-click for reasons other than the context menu.
-    ContextMenuController* controller = page->contextMenuController();
-    ContextMenu* coreMenu = controller->contextMenu();
+    ContextMenu* coreMenu = page->contextMenuController().contextMenu();
     if (!coreMenu)
         return mousePressEventResult;
 
@@ -391,7 +390,7 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie
 
     // We connect the "activate" signal here rather than in ContextMenuGtk to avoid
     // a layering violation. ContextMenuGtk should not know about the ContextMenuController.
-    gtk_container_foreach(GTK_CONTAINER(defaultMenu), reinterpret_cast<GtkCallback>(contextMenuConnectActivate), controller);
+    gtk_container_foreach(GTK_CONTAINER(defaultMenu), reinterpret_cast<GtkCallback>(contextMenuConnectActivate), &page->contextMenuController());
 
     if (!hitTestResult) {
         MouseEventWithHitTestResults mev = prepareMouseEventForFrame(focusedFrame, event);
@@ -5424,7 +5423,7 @@ GtkMenu* webkit_web_view_get_context_menu(WebKitWebView* webView)
     g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), 0);
 
 #if ENABLE(CONTEXT_MENUS)
-    ContextMenu* menu = core(webView)->contextMenuController()->contextMenu();
+    ContextMenu* menu = core(webView)->contextMenuController().contextMenu();
     if (!menu)
         return 0;
     return menu->platformDescription();
index 1d5191b54ec8f4230796af8458613eb89ed1af71..c4cc6c602b418be1cc7316bf4bc15adef942d939 100644 (file)
@@ -272,7 +272,7 @@ NSMutableArray* WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu*
     if (![delegate respondsToSelector:selector])
         return defaultMenu->platformDescription();
 
-    NSDictionary *element = [[[WebElementDictionary alloc] initWithHitTestResult:[m_webView page]->contextMenuController()->hitTestResult()] autorelease];
+    NSDictionary *element = [[[WebElementDictionary alloc] initWithHitTestResult:[m_webView page]->contextMenuController().hitTestResult()] autorelease];
 
     BOOL preVersion3Client = isPreVersion3Client();
     if (preVersion3Client) {
@@ -302,7 +302,7 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const
     id delegate = [m_webView UIDelegate];
     SEL selector = @selector(webView:contextMenuItemSelected:forElement:);
     if ([delegate respondsToSelector:selector]) {
-        NSDictionary *element = [[WebElementDictionary alloc] initWithHitTestResult:[m_webView page]->contextMenuController()->hitTestResult()];
+        NSDictionary *element = [[WebElementDictionary alloc] initWithHitTestResult:[m_webView page]->contextMenuController().hitTestResult()];
         NSMenuItem *platformItem = item->releasePlatformDescription();
 
         CallUIDelegate(m_webView, selector, platformItem, element);
@@ -355,15 +355,14 @@ void WebContextMenuClient::showContextMenu()
     Page* page = [m_webView page];
     if (!page)
         return;
-    ContextMenuController* controller = page->contextMenuController();
-    Frame* frame = controller->hitTestResult().innerNodeFrame();
+    Frame* frame = page->contextMenuController().hitTestResult().innerNodeFrame();
     if (!frame)
         return;
     FrameView* frameView = frame->view();
     if (!frameView)
         return;
 
-    IntPoint point = frameView->contentsToWindow(controller->hitTestResult().roundedPointInInnerNodeFrame());
+    IntPoint point = frameView->contentsToWindow(page->contextMenuController().hitTestResult().roundedPointInInnerNodeFrame());
     NSView* view = frameView->documentView();
     NSPoint nsScreenPoint = [view convertPoint:point toView:nil];
     // Show the contextual menu for this event.
index 5be82a935434f7df138c781bd133574ac9231177..1337d3b0dbf58bd00e9f822ebf3a5fe0a62f6428 100644 (file)
@@ -3111,7 +3111,7 @@ static void setMenuTargets(NSMenu* menu)
 
     // Match behavior of other browsers by sending a mousedown event for right clicks.
     _private->handlingMouseDownEvent = YES;
-    page->contextMenuController()->clearContextMenu();
+    page->contextMenuController().clearContextMenu();
     coreFrame->eventHandler().mouseDown(event);
     BOOL handledEvent = coreFrame->eventHandler().sendContextMenuEvent(PlatformEventFactory::createPlatformMouseEvent(event, page->chrome().platformPageClient()));
     _private->handlingMouseDownEvent = NO;
@@ -3124,7 +3124,7 @@ static void setMenuTargets(NSMenu* menu)
     if (!page)
         return nil;
 
-    ContextMenu* coreMenu = page->contextMenuController()->contextMenu();
+    ContextMenu* coreMenu = page->contextMenuController().contextMenu();
     if (!coreMenu)
         return nil;
 
@@ -3141,7 +3141,7 @@ static void setMenuTargets(NSMenu* menu)
         [menu addItem:[menuItems objectAtIndex:i]];
     setMenuTargets(menu);
     
-    [[WebMenuTarget sharedMenuTarget] setMenuController:page->contextMenuController()];
+    [[WebMenuTarget sharedMenuTarget] setMenuController:&page->contextMenuController()];
     
     return menu;
 }
index 76c1853b66eba914a488b02c9c30906e56a56138..3cdaeed4b11abd3e4116593babc98b919876dc5f 100644 (file)
@@ -875,7 +875,7 @@ QList<MenuItem> descriptionForPlatformMenu(const Vector<ContextMenuItem>& items,
                 description.type = MenuItem::Action;
                 description.action = action;
                 ContextMenuItem it(item);
-                page->contextMenuController()->checkOrEnableIfNeeded(it);
+                page->contextMenuController().checkOrEnableIfNeeded(it);
                 if (it.enabled())
                     description.traits |= MenuItem::Enabled;
                 if (item.type() == WebCore::CheckableActionType) {
@@ -909,14 +909,14 @@ QWebHitTestResultPrivate* QWebPageAdapter::updatePositionDependentMenuActions(co
     ASSERT(visitedWebActions);
     WebCore::Frame* focusedFrame = page->focusController().focusedOrMainFrame();
     HitTestResult result = focusedFrame->eventHandler().hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos));
-    page->contextMenuController()->setHitTestResult(result);
+    page->contextMenuController().setHitTestResult(result);
 
 #if ENABLE(INSPECTOR)
     if (page->inspectorController()->enabled())
-        page->contextMenuController()->addInspectElementItem();
+        page->contextMenuController().addInspectElementItem();
 #endif
 
-    WebCore::ContextMenu* webcoreMenu = page->contextMenuController()->contextMenu();
+    WebCore::ContextMenu* webcoreMenu = page->contextMenuController().contextMenu();
     QList<MenuItem> itemDescriptions;
     if (client && webcoreMenu)
         itemDescriptions = descriptionForPlatformMenu(webcoreMenu->items(), page);
@@ -1423,7 +1423,7 @@ bool QWebPageAdapter::swallowContextMenuEvent(QContextMenuEvent *event, QWebFram
     ASSERT(int(QWebPageAdapter::ScrollByLine) == int(WebCore::ScrollByLine));
     ASSERT(int(QWebPageAdapter::ScrollByDocument) == int(WebCore::ScrollByDocument));
 
-    page->contextMenuController()->clearContextMenu();
+    page->contextMenuController().clearContextMenu();
 
     if (webFrame) {
         Frame* frame = webFrame->frame;
@@ -1451,7 +1451,7 @@ bool QWebPageAdapter::swallowContextMenuEvent(QContextMenuEvent *event, QWebFram
 
     WebCore::Frame* focusedFrame = page->focusController().focusedOrMainFrame();
     focusedFrame->eventHandler().sendContextMenuEvent(convertMouseEvent(event, 1));
-    ContextMenu* menu = page->contextMenuController()->contextMenu();
+    ContextMenu* menu = page->contextMenuController().contextMenu();
     // If the website defines its own handler then sendContextMenuEvent takes care of
     // calling/showing it and the context menu pointer will be zero. This is the case
     // on maps.google.com for example.
index 380c8bb1e6fd4a67ca5140ef7e459f438666d1d0..560f2cf6c8113dce1413a6735530fb1e164f56d0 100644 (file)
@@ -66,7 +66,7 @@ PassOwnPtr<ContextMenu> WebContextMenuClient::customizeMenu(PassOwnPtr<ContextMe
 
     HMENU nativeMenu = menu->platformContextMenu();
     COMPtr<WebElementPropertyBag> propertyBag;
-    propertyBag.adoptRef(WebElementPropertyBag::createInstance(m_webView->page()->contextMenuController()->hitTestResult()));
+    propertyBag.adoptRef(WebElementPropertyBag::createInstance(m_webView->page()->contextMenuController().hitTestResult()));
     // FIXME: We need to decide whether to do the default before calling this delegate method
     if (FAILED(uiDelegate->contextMenuItemsForElement(m_webView, propertyBag.get(), (OLE_HANDLE)(ULONG64)nativeMenu, (OLE_HANDLE*)&nativeMenu))) {
         ::DestroyMenu(nativeMenu);
@@ -90,7 +90,7 @@ void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const
     ASSERT(uiDelegate);
 
     COMPtr<WebElementPropertyBag> propertyBag;
-    propertyBag.adoptRef(WebElementPropertyBag::createInstance(m_webView->page()->contextMenuController()->hitTestResult()));
+    propertyBag.adoptRef(WebElementPropertyBag::createInstance(m_webView->page()->contextMenuController().hitTestResult()));
 
     // This call would leak the MENUITEMINFO's subMenu if it had one, but on Windows, subMenus can't be selected, so there is
     // no way we would get to this point. Also, it can't be a separator, because separators cannot be selected.
index 2265466a367e49a5eab96e4f9326c879fd606d8a..f610c07706db0ae91d7bb970d8d8e944a4bcf71d 100644 (file)
@@ -1334,7 +1334,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
         // through the DOM so that we can detect if we create a new menu for this event, since we
         // won't create a new menu if the DOM swallows the event and the defaultEventHandler does
         // not run.
-        m_page->contextMenuController()->clearContextMenu();
+        m_page->contextMenuController().clearContextMenu();
 
         Frame* focusedFrame = m_page->focusController().focusedOrMainFrame();
         return focusedFrame->eventHandler().sendContextMenuEventForKey();
@@ -1346,7 +1346,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
 
     lParam = MAKELPARAM(coords.x, coords.y);
 
-    m_page->contextMenuController()->clearContextMenu();
+    m_page->contextMenuController().clearContextMenu();
 
     IntPoint documentPoint(m_page->mainFrame()->view()->windowToContents(coords));
     HitTestResult result = m_page->mainFrame()->eventHandler().hitTestResultAtPoint(documentPoint);
@@ -1358,14 +1358,14 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
     if (!handledEvent)
         return false;
 
-    ContextMenuController* contextMenuController = m_page->contextMenuController();
+    ContextMenuController& contextMenuController = m_page->contextMenuController();
 
     // Show the menu
-    ContextMenu* coreMenu = contextMenuController->contextMenu();
+    ContextMenu* coreMenu = contextMenuController.contextMenu();
     if (!coreMenu)
         return false;
 
-    Frame* frame = contextMenuController->hitTestResult().innerNodeFrame();
+    Frame* frame = contextMenuController.hitTestResult().innerNodeFrame();
     if (!frame)
         return false;
 
@@ -1373,7 +1373,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
     if (!view)
         return false;
 
-    POINT point(view->contentsToWindow(contextMenuController->hitTestResult().roundedPointInInnerNodeFrame()));
+    POINT point(view->contentsToWindow(contextMenuController.hitTestResult().roundedPointInInnerNodeFrame()));
 
     // Translate the point to screen coordinates
     if (!::ClientToScreen(m_viewWindow, &point))
@@ -1461,13 +1461,13 @@ bool WebView::onUninitMenuPopup(WPARAM wParam, LPARAM /*lParam*/)
 
 void WebView::performContextMenuAction(WPARAM wParam, LPARAM lParam, bool byPosition)
 {
-    ContextMenu* menu = m_page->contextMenuController()->contextMenu();
+    ContextMenu* menu = m_page->contextMenuController().contextMenu();
     ASSERT(menu);
 
     ContextMenuItem* item = byPosition ? menu->itemAtIndex((unsigned)wParam) : menu->itemWithAction((ContextMenuAction)wParam);
     if (!item)
         return;
-    m_page->contextMenuController()->contextMenuItemSelected(item);
+    m_page->contextMenuController().contextMenuItemSelected(item);
 }
 
 bool WebView::handleMouseEvent(UINT message, WPARAM wParam, LPARAM lParam)
index ae9d6ac143c4dc71557e7e35f00f9afb8bab90aa..56ae0849f5999a4afb896237c8051af05bcb17a8 100644 (file)
@@ -52,13 +52,11 @@ WebContextMenu::~WebContextMenu()
 
 void WebContextMenu::show()
 {
-    ContextMenuController* controller = m_page->corePage()->contextMenuController();
-    if (!controller)
-        return;
-    ContextMenu* menu = controller->contextMenu();
+    ContextMenuController& controller = m_page->corePage()->contextMenuController();
+    ContextMenu* menu = controller.contextMenu();
     if (!menu)
         return;
-    Frame* frame = controller->hitTestResult().innerNodeFrame();
+    Frame* frame = controller.hitTestResult().innerNodeFrame();
     if (!frame)
         return;
     FrameView* view = frame->view();
@@ -68,26 +66,24 @@ void WebContextMenu::show()
     Vector<WebContextMenuItemData> menuItems;
     RefPtr<APIObject> userData;
     menuItemsWithUserData(menuItems, userData);
-    WebHitTestResult::Data webHitTestResultData(controller->hitTestResult());
+    WebHitTestResult::Data webHitTestResultData(controller.hitTestResult());
 
     // Mark the WebPage has having a shown context menu then notify the UIProcess.
     m_page->contextMenuShowing();
-    m_page->send(Messages::WebPageProxy::ShowContextMenu(view->contentsToWindow(controller->hitTestResult().roundedPointInInnerNodeFrame()), webHitTestResultData, menuItems, InjectedBundleUserMessageEncoder(userData.get())));
+    m_page->send(Messages::WebPageProxy::ShowContextMenu(view->contentsToWindow(controller.hitTestResult().roundedPointInInnerNodeFrame()), webHitTestResultData, menuItems, InjectedBundleUserMessageEncoder(userData.get())));
 }
 
 void WebContextMenu::itemSelected(const WebContextMenuItemData& item)
 {
     ContextMenuItem coreItem(ActionType, static_cast<ContextMenuAction>(item.action()), item.title());
-    m_page->corePage()->contextMenuController()->contextMenuItemSelected(&coreItem);
+    m_page->corePage()->contextMenuController().contextMenuItemSelected(&coreItem);
 }
 
 void WebContextMenu::menuItemsWithUserData(Vector<WebContextMenuItemData> &menuItems, RefPtr<APIObject>& userData) const
 {
-    ContextMenuController* controller = m_page->corePage()->contextMenuController();
-    if (!controller)
-        return;
+    ContextMenuController& controller = m_page->corePage()->contextMenuController();
 
-    ContextMenu* menu = controller->contextMenu();
+    ContextMenu* menu = controller.contextMenu();
     if (!menu)
         return;
 
@@ -99,7 +95,7 @@ void WebContextMenu::menuItemsWithUserData(Vector<WebContextMenuItemData> &menuI
 #endif
     Vector<WebContextMenuItemData> proposedMenu = kitItems(coreItems, menu);
     Vector<WebContextMenuItemData> newMenu;
-    RefPtr<InjectedBundleHitTestResult> hitTestResult = InjectedBundleHitTestResult::create(controller->hitTestResult());
+    RefPtr<InjectedBundleHitTestResult> hitTestResult = InjectedBundleHitTestResult::create(controller.hitTestResult());
     if (m_page->injectedBundleContextMenuClient().getCustomMenuFromDefaultItems(m_page, hitTestResult.get(), proposedMenu, newMenu, userData))
         proposedMenu = newMenu;
     menuItems = proposedMenu;
index b072cfce2407d0a954a1cafc871f535a724bec47..79ffacec891496eae3d949c7b3194ba574a1a14a 100644 (file)
@@ -1560,7 +1560,7 @@ WebContextMenu* WebPage::contextMenu()
 
 WebContextMenu* WebPage::contextMenuAtPointInWindow(const IntPoint& point)
 {
-    corePage()->contextMenuController()->clearContextMenu();
+    corePage()->contextMenuController().clearContextMenu();
     
     // Simulate a mouse click to generate the correct menu.
     PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime());
@@ -1645,7 +1645,7 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, boo
         case PlatformEvent::MousePressed: {
 #if ENABLE(CONTEXT_MENUS)
             if (isContextClick(platformMouseEvent))
-                page->corePage()->contextMenuController()->clearContextMenu();
+                page->corePage()->contextMenuController().clearContextMenu();
 #endif
 
             bool handled = frame->eventHandler().handleMousePressEvent(platformMouseEvent);