Remove ChromeClient::willPopupMenu
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 May 2013 23:17:59 +0000 (23:17 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 May 2013 23:17:59 +0000 (23:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116063

Reviewed by Andreas Kling.

Source/WebCore:

Remove ChromeClient::willPopupMenu.

* page/ChromeClient.h:

Source/WebKit/mac:

ChromeClient::willPopupMenu is only called in one place from WebKit, so just move the function to the call site.

* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:

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

Source/WebCore/ChangeLog
Source/WebCore/page/ChromeClient.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm

index aefc974..36962f8 100644 (file)
@@ -1,3 +1,14 @@
+2013-05-13  Anders Carlsson  <andersca@apple.com>
+
+        Remove ChromeClient::willPopupMenu
+        https://bugs.webkit.org/show_bug.cgi?id=116063
+
+        Reviewed by Andreas Kling.
+
+        Remove ChromeClient::willPopupMenu.
+
+        * page/ChromeClient.h:
+
 2013-05-13  Beth Dakin  <bdakin@apple.com>
 
         Headers and footers should be pinned to the left edge of the window when scrolling 
index e52156f..38912e8 100644 (file)
 #include "DatabaseDetails.h"
 #endif
 
-#ifndef __OBJC__
-class NSMenu;
-class NSResponder;
-#endif
+OBJC_CLASS NSResponder;
 
 namespace WebCore {
 
@@ -313,7 +310,6 @@ public:
     virtual void makeFirstResponder(NSResponder *) { }
     // Focuses on the containing view associated with this page.
     virtual void makeFirstResponder() { }
-    virtual void willPopUpMenu(NSMenu *) { }
 #endif
 
     virtual void enableSuddenTermination() { }
index 62cd7c6..6a2a761 100644 (file)
@@ -1,3 +1,17 @@
+2013-05-13  Anders Carlsson  <andersca@apple.com>
+
+        Remove ChromeClient::willPopupMenu
+        https://bugs.webkit.org/show_bug.cgi?id=116063
+
+        Reviewed by Andreas Kling.
+
+        ChromeClient::willPopupMenu is only called in one place from WebKit, so just move the function to the call site.
+
+        * WebCoreSupport/PopupMenuMac.mm:
+        (PopupMenuMac::show):
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+
 2013-05-12  Timothy Hatcher  <timothy@apple.com>
 
         Add support for updating the Web Inspector toolbar height.
index 0bbc825..58f8780 100644 (file)
 
 #import "PopupMenuMac.h"
 
+#import "WebDelegateImplementationCaching.h"
+#import "WebFrameInternal.h"
 #import <WebCore/IntRect.h>
 #import <WebCore/AXObjectCache.h>
+#import <WebCore/BlockExceptions.h>
 #import <WebCore/Chrome.h>
 #import <WebCore/ChromeClient.h>
 #import <WebCore/EventHandler.h>
@@ -178,8 +181,13 @@ void PopupMenuMac::show(const IntRect& r, FrameView* v, int index)
     [view addSubview:dummyView.get()];
     location = [dummyView convertPoint:location fromView:view];
     
-    if (Page* page = frame->page())
-        page->chrome()->client()->willPopUpMenu(menu);
+    if (Page* page = frame->page()) {
+        WebView* webView = kit(page);
+        BEGIN_BLOCK_OBJC_EXCEPTIONS;
+        CallUIDelegate(webView, @selector(webView:willPopupMenu:), menu);
+        END_BLOCK_OBJC_EXCEPTIONS;
+    }
+
     wkPopupMenu(menu, location, roundf(NSWidth(r)), dummyView.get(), index, font);
 
     [m_popup dismissPopUp];
index ab90d8f..43319be 100644 (file)
@@ -135,8 +135,6 @@ public:
     virtual NSResponder *firstResponder() OVERRIDE;
     virtual void makeFirstResponder(NSResponder *) OVERRIDE;
 
-    virtual void willPopUpMenu(NSMenu *) OVERRIDE;
-
     virtual void enableSuddenTermination() OVERRIDE;
     virtual void disableSuddenTermination() OVERRIDE;
     
index fbf4da3..cfbdbc6 100644 (file)
@@ -807,13 +807,6 @@ void WebChromeClient::makeFirstResponder(NSResponder *responder)
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-void WebChromeClient::willPopUpMenu(NSMenu *menu)
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    CallUIDelegate(m_webView, @selector(webView:willPopupMenu:), menu);
-    END_BLOCK_OBJC_EXCEPTIONS;
-}
-
 void WebChromeClient::enableSuddenTermination()
 {
     [[NSProcessInfo processInfo] enableSuddenTermination];