Commit a5398c7b authored by jcivelli@chromium.org's avatar jcivelli@chromium.org
Browse files

2011-02-07 Jay Civelli <jcivelli@chromium.org>

        Reviewed by Darin Fisher.

        Removing unused code from PopupMenuChromium.
        https://bugs.webkit.org/show_bug.cgi?id=53866

       * platform/chromium/PopupMenuChromium.cpp:
        (WebCore::PopupListBox::layout):
        (WebCore::PopupMenuChromium::show):
        * platform/chromium/PopupMenuChromium.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f577f0bd
2011-02-07 Jay Civelli <jcivelli@chromium.org>
Reviewed by Darin Fisher.
Removing unused code from PopupMenuChromium.
https://bugs.webkit.org/show_bug.cgi?id=53866
* platform/chromium/PopupMenuChromium.cpp:
(WebCore::PopupListBox::layout):
(WebCore::PopupMenuChromium::show):
* platform/chromium/PopupMenuChromium.h:
2011-02-07 Kenichi Ishibashi <bashi@chromium.org>
 
Reviewed by Andreas Kling.
......@@ -398,34 +398,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();
......@@ -1310,27 +1282,16 @@ 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;
}
......@@ -1398,19 +1359,11 @@ 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()
......
......@@ -126,9 +126,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment