Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: third_party/WebKit/WebCore/platform/chromium/PopupMenuChromium.h

Issue 67017: Merge in the WebKit popup menu changes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/WebCore/platform/chromium/PopupMenuChromium.h
===================================================================
--- third_party/WebKit/WebCore/platform/chromium/PopupMenuChromium.h (revision 13377)
+++ third_party/WebKit/WebCore/platform/chromium/PopupMenuChromium.h (working copy)
@@ -42,6 +42,23 @@
class FrameView;
class PopupListBox;
+ // A container for the data for each menu item (e.g. represented by <option>
+ // or <optgroup> in a <select> widget) and is used by PopupListBox.
+ struct PopupItem {
+ enum Type {
+ TypeOption,
+ TypeGroup,
+ TypeSeparator
+ };
+
+ PopupItem(const String& label, Type type)
+ : label(label), type(type), yOffset(0) { }
+ String label;
+ Type type;
+ int yOffset; // y offset of this item, relative to the top of the popup.
+ bool enabled;
+ };
+
// FIXME: Our FramelessScrollView classes should probably implement HostWindow!
// The PopupContainer class holds a PopupListBox (see cpp file). Its sole purpose is to be
@@ -94,9 +111,14 @@
// 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.
+ // so WebViewImpl can create a PopupContainer. This method is used for
+ // displaying auto complete popup menus on Mac Chromium, and for all
+ // popups on other platforms.
void show(const IntRect&, FrameView*, int index);
// Hide the popup. Do not call this directly: use client->hidePopup().
@@ -114,6 +136,12 @@
// Refresh the popup values from the PopupMenuClient.
void refresh();
+ // The menu per-item data.
+ const WTF::Vector<PopupItem*>& popupData() const;
+
+ // The height of a row in the menu.
+ int menuItemHeight() const;
+
private:
friend class WTF::RefCounted<PopupContainer>;

Powered by Google App Engine
This is Rietveld 408576698