summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/gtk/menu_gtk.h
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-04 01:16:12 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-04 01:16:12 +0000
commite9ef1db24e1468bc378dffa650a0e56c794ee761 (patch)
tree46f1e10eae2eaf5c4ba2bb895f37768db468b9e1 /chrome/browser/ui/gtk/menu_gtk.h
parent46c74e569cb53ab4e283fa08d9938282a9a21a1e (diff)
downloadchromium_src-e9ef1db24e1468bc378dffa650a0e56c794ee761.zip
chromium_src-e9ef1db24e1468bc378dffa650a0e56c794ee761.tar.gz
chromium_src-e9ef1db24e1468bc378dffa650a0e56c794ee761.tar.bz2
gtk: simplify menuing API
Bug 71821 looks like it was caused by using the wrong menu API, but it wasn't obvious because there were so many entry points. This change simplifies it to two main entry points -- one for context menus (which belong at the mouse position) and one for button-initiated menus (which belong alongside the button, like the wrench menu). This also makes the right-click menu in the task manager come up on mouse-down on GTK, as that is how right-click menus should work. BUG=71821 TEST=bring up a notification, click the wrench, pick an item from the submenu; the selection should take effect Review URL: http://codereview.chromium.org/6250145 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk/menu_gtk.h')
-rw-r--r--chrome/browser/ui/gtk/menu_gtk.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/chrome/browser/ui/gtk/menu_gtk.h b/chrome/browser/ui/gtk/menu_gtk.h
index 2fdb2eb..fc9a048 100644
--- a/chrome/browser/ui/gtk/menu_gtk.h
+++ b/chrome/browser/ui/gtk/menu_gtk.h
@@ -75,20 +75,17 @@ class MenuGtk {
GtkWidget* menu,
bool connect_to_activate);
- // Displays the menu. |timestamp| is the time of activation. The popup is
- // statically positioned at |widget|.
- void Popup(GtkWidget* widget, gint button_type, guint32 timestamp);
-
- // Displays the menu using the button type and timestamp of |event|. The popup
- // is statically positioned at |widget|.
- void Popup(GtkWidget* widget, GdkEvent* event);
-
- // Displays the menu as a context menu, i.e. at the current cursor location.
+ // Displays the menu near a widget, as if the widget were a menu bar.
+ // Example: the wrench menu button.
+ // |button| is the mouse button that brought up the menu.
+ // |event_time| is the time from the GdkEvent.
+ void PopupForWidget(GtkWidget* widget, int button, guint32 event_time);
+
+ // Displays the menu as a context menu, i.e. at the cursor location.
+ // It is implicit that it was brought up using the right mouse button.
+ // |point| is the point where to put the menu.
// |event_time| is the time of the event that triggered the menu's display.
- void PopupAsContext(guint32 event_time);
-
- // Displays the menu at the given coords. |point| is intentionally not const.
- void PopupAsContextAt(guint32 event_time, gfx::Point point);
+ void PopupAsContext(const gfx::Point& point, guint32 event_time);
// Displays the menu as a context menu for the passed status icon.
void PopupAsContextForStatusIcon(guint32 event_time, guint32 button,