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

Unified Diff: webkit/glue/webwidget_delegate.h

Issue 48149: Use cocoa controls for HTML select popups in test_shell (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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: webkit/glue/webwidget_delegate.h
===================================================================
--- webkit/glue/webwidget_delegate.h (revision 12371)
+++ webkit/glue/webwidget_delegate.h (working copy)
@@ -5,7 +5,11 @@
#ifndef WEBKIT_GLUE_WEBWIDGET_DELEGATE_H__
#define WEBKIT_GLUE_WEBWIDGET_DELEGATE_H__
+#include <string>
+#include <vector>
+
#include "base/gfx/native_widget_types.h"
+#include "base/string16.h"
#include "webkit/glue/window_open_disposition.h"
namespace gfx {
@@ -17,6 +21,22 @@
class WebCursor;
struct WebPluginGeometry;
+struct MenuItem {
darin (slow to review) 2009/04/01 18:02:50 sorry for the after-the-fact review... MenuItem s
+ // Container for information about entries in an HTML select popup menu.
+ // Types must be kept in sync with PopupListBox::ListItemType in
+ // WebCore/platform/chromium/PopupMenuChromium.h. This won't change often
+ // (if ever).
+ enum Type {
+ OPTION = 0,
+ GROUP,
+ SEPARATOR
+ };
+
+ string16 label;
+ Type type;
+ bool enabled;
+};
+
class WebWidgetDelegate {
public:
// Returns the view in which the WebWidget is embedded.
@@ -36,6 +56,22 @@
// window should be displayed, but generally only means something for WebViews.
virtual void Show(WebWidget* webwidget, WindowOpenDisposition disposition) = 0;
+ // Used for displaying HTML select elements as popup menus on Mac OS X (other
darin (slow to review) 2009/04/01 18:02:50 as mentioned in the bugs.webkit.org review, this k
+ // platforms will use Show() above). |bounds| represents the positioning on
+ // the screen (in WebKit coordinates, origin at the top left corner) of the
+ // button that will display the menu. It will be used, along with
+ // |item_height| (which refers to the size of each entry in the menu), to
+ // position the menu on the screen. |selected_index| indicates the menu item
+ // that should be drawn as selected when the menu initially is displayed.
+ // |items| contains information about each of the entries in the popup menu,
+ // such as the type (separator, option, group), the text representation and
+ // the item's enabled status.
+ virtual void ShowWithItems(WebWidget* webwidget,
+ const gfx::Rect& bounds,
+ int item_height,
+ int selected_index,
+ const std::vector<MenuItem>& items) = 0;
+
// This method is called to instruct the window containing the WebWidget to
// close. Note: This method should just be the trigger that causes the
// WebWidget to eventually close. It should not actually be destroyed until
@@ -91,7 +127,7 @@
virtual ~WebWidgetDelegate() { }
private:
- DISALLOW_EVIL_CONSTRUCTORS(WebWidgetDelegate);
+ DISALLOW_COPY_AND_ASSIGN(WebWidgetDelegate);
};
#endif // #ifndef WEBKIT_GLUE_WEBWIDGET_DELEGATE_H__

Powered by Google App Engine
This is Rietveld 408576698