2010-11-19 Jay Civelli <jcivelli@chromium.org>
authorjcivelli@chromium.org <jcivelli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Nov 2010 15:38:58 +0000 (15:38 +0000)
committerjcivelli@chromium.org <jcivelli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Nov 2010 15:38:58 +0000 (15:38 +0000)
        Reviewed by David Levin.

        [chromium] Removing the now unused code to show popup externally on Mac.
        https://bugs.webkit.org/show_bug.cgi?id=49747

        * page/chromium/ChromeClientChromium.h:
        * platform/chromium/PopupMenuChromium.cpp:
        (WebCore::PopupContainer::showPopup):
        (WebCore::PopupListBox::layout):
        (WebCore::PopupMenuChromium::show):
        * platform/chromium/PopupMenuChromium.h:
2010-11-19  Jay Civelli  <jcivelli@chromium.org>

        Reviewed by David Levin.

        Removing unused code to show popup externally on Mac.
        https://bugs.webkit.org/show_bug.cgi?id=49747

        * src/ChromeClientImpl.cpp:
        (WebKit::ChromeClientImpl::popupOpened):
        * src/ChromeClientImpl.h:

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

WebCore/ChangeLog
WebCore/page/chromium/ChromeClientChromium.h
WebCore/platform/chromium/PopupMenuChromium.cpp
WebCore/platform/chromium/PopupMenuChromium.h
WebKit/chromium/ChangeLog
WebKit/chromium/src/ChromeClientImpl.cpp
WebKit/chromium/src/ChromeClientImpl.h

index 280c0f0..fd87476 100644 (file)
@@ -1,3 +1,17 @@
+2010-11-19  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by David Levin.
+
+        [chromium] Removing the now unused code to show popup externally on Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=49747
+
+        * page/chromium/ChromeClientChromium.h:
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupContainer::showPopup):
+        (WebCore::PopupListBox::layout):
+        (WebCore::PopupMenuChromium::show):
+        * platform/chromium/PopupMenuChromium.h:
+
 2010-11-18  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 02e2a94..b518b3d 100644 (file)
@@ -44,11 +44,9 @@ class ChromeClientChromium : public ChromeClient {
 public:
     // Notifies the client of a new popup widget.  The client should place
     // and size the widget with the given bounds, relative to the screen.
-    // If handleExternal is true, then drawing and input handling for the
-    // popup will be handled by the external embedder.
-    virtual void popupOpened(PopupContainer* popupContainer, const IntRect& bounds,
-                             bool handleExternal) = 0;
-                             
+    virtual void popupOpened(PopupContainer* popupContainer,
+                             const IntRect& bounds) = 0;
+
     // Notifies the client a popup was closed.
     virtual void popupClosed(PopupContainer* popupContainer) = 0;
 };
index 04eeb93..7a3024b 100644 (file)
@@ -371,7 +371,7 @@ void PopupContainer::showPopup(FrameView* view)
                     widgetRect.move(0, -(widgetRect.height() + selectHeight));
             }
         }
-        chromeClient->popupOpened(this, widgetRect, false);
+        chromeClient->popupOpened(this, widgetRect);
         m_popupOpen = true;
     }
 
@@ -387,34 +387,6 @@ void PopupContainer::showPopup(FrameView* view)
     invalidate();
 }
 
-void PopupContainer::showExternal(const IntRect& rect, FrameView* v, int index)
-{
-    if (!listBox())
-        return;
-
-    listBox()->setBaseWidth(rect.width());
-    listBox()->updateFromElement();
-
-    if (listBox()->numItems() < 1) {
-        hidePopup();
-        return;
-    }
-
-    // Adjust the popup position to account for scrolling.
-    IntPoint location = v->contentsToWindow(rect.location());
-    IntRect popupRect(location, rect.size());
-
-    // Get the ChromeClient and pass it the popup menu's listbox data.
-    m_frameView = v;
-    chromeClientChromium()->popupOpened(this, popupRect, true);
-
-    // The popup sends its "closed" notification through its parent. Set the
-    // parent, even though external popups have no real on-screen widget but a
-    // native menu (see |PopupListBox::hidePopup()|);
-    if (!m_listBox->parent())
-        addChild(m_listBox.get());
-}
-
 void PopupContainer::hidePopup()
 {
     listBox()->hidePopup();
@@ -1296,27 +1268,14 @@ void PopupListBox::layout()
     // Calculate scroll bar width.
     int windowHeight = 0;
 
-#if OS(DARWIN)
-    // Set the popup's window to contain all available items on Mac only, which
-    // uses native controls that manage their own scrolling. This allows hit
-    // testing to work when selecting items in popups that have more menu entries
-    // than the maximum window size.
-    m_visibleRows = numItems();
-#else
     m_visibleRows = min(numItems(), kMaxVisibleRows);
-#endif
 
     for (int i = 0; i < m_visibleRows; ++i) {
         int rowHeight = getRowHeight(i);
-
-#if !OS(DARWIN)
-        // Only clip the window height for non-Mac platforms.
         if (windowHeight + rowHeight > m_maxHeight) {
             m_visibleRows = i;
             break;
         }
-#endif
-
         windowHeight += rowHeight;
     }
 
@@ -1383,19 +1342,13 @@ PopupMenuChromium::~PopupMenuChromium()
     hide();
 }
 
-// The Mac Chromium implementation relies on external control (a Cocoa control)
-// to display, handle the input tracking and menu item selection for the popup.
 // Windows and Linux Chromium let our WebKit port handle the display, while
 // another process manages the popup window and input handling.
 void PopupMenuChromium::show(const IntRect& r, FrameView* v, int index)
 {
     if (!p.popup)
         p.popup = PopupContainer::create(client(), PopupContainer::Select, dropDownSettings);
-#if OS(DARWIN)
-    p.popup->showExternal(r, v, index);
-#else
     p.popup->show(r, v, index);
-#endif
 }
 
 void PopupMenuChromium::hide()
index ca47ccf..76665ff 100644 (file)
@@ -142,9 +142,6 @@ public:
     // Show the popup
     void showPopup(FrameView*);
 
-    // Used on Mac Chromium for HTML select popup menus.
-    void showExternal(const IntRect&, FrameView*, int index);
-
     // Show the popup in the specified rect for the specified frame.
     // Note: this code was somehow arbitrarily factored-out of the Popup class
     // so WebViewImpl can create a PopupContainer. This method is used for
index 04be936..4a58f88 100644 (file)
@@ -1,3 +1,14 @@
+2010-11-19  Jay Civelli  <jcivelli@chromium.org>
+
+        Reviewed by David Levin.
+
+        Removing unused code to show popup externally on Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=49747
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::popupOpened):
+        * src/ChromeClientImpl.h:
+
 2010-11-19  Pavel Feldman  <pfeldman@chromium.org>
 
         Not reviewed: flip chromium version to mitigate two-sided patch impact.
index c43a0b0..9e9fc41 100644 (file)
@@ -678,25 +678,14 @@ void ChromeClientImpl::chooseIconForFiles(const Vector<WTF::String>&, WebCore::F
 }
 
 void ChromeClientImpl::popupOpened(PopupContainer* popupContainer,
-                                   const IntRect& bounds,
-                                   bool handleExternally)
+                                   const IntRect& bounds)
 {
     if (!m_webView->client())
         return;
 
-    WebWidget* webwidget;
-    if (handleExternally) {
-        WebPopupMenuInfo popupInfo;
-        getPopupMenuInfo(popupContainer, &popupInfo);
-        webwidget = m_webView->client()->createPopupMenu(popupInfo);
-    } else {
-        webwidget = m_webView->client()->createPopupMenu(
-            convertPopupType(popupContainer->popupType()));
-        // We only notify when the WebView has to handle the popup, as when
-        // the popup is handled externally, the fact that a popup is showing is
-        // transparent to the WebView.
-        m_webView->popupOpened(popupContainer);
-    }
+    WebWidget* webwidget = m_webView->client()->createPopupMenu(
+        convertPopupType(popupContainer->popupType()));
+    m_webView->popupOpened(popupContainer);
     static_cast<WebPopupMenuImpl*>(webwidget)->Init(popupContainer, bounds);
 }
 
index 87c1653..fde46df 100644 (file)
@@ -162,8 +162,7 @@ public:
 
     // ChromeClientChromium methods:
     virtual void popupOpened(WebCore::PopupContainer* popupContainer,
-                             const WebCore::IntRect& bounds,
-                             bool handleExternally);
+                             const WebCore::IntRect& bounds);
     virtual void popupClosed(WebCore::PopupContainer* popupContainer);
     virtual void postAccessibilityNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXNotification);