diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 23:59:22 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 23:59:22 +0000 |
commit | a1390e34ecb69f4e1840788dd86a3912cbbc2e7e (patch) | |
tree | 39f85efefc6c2bff86cdbf0fee93cff6cfe0faaa /chrome/browser/gtk/menu_gtk.h | |
parent | 2a3a3c38e7c0b2b1059d383e228f73ab807f6cdc (diff) | |
download | chromium_src-a1390e34ecb69f4e1840788dd86a3912cbbc2e7e.zip chromium_src-a1390e34ecb69f4e1840788dd86a3912cbbc2e7e.tar.gz chromium_src-a1390e34ecb69f4e1840788dd86a3912cbbc2e7e.tar.bz2 |
GTK: Display context menus on right-clicking a bookmark menu item.
- Refactors events so as a side effect, shift or control clicking a bookmark
menu item opens with the correct disposition.
- Moves away from use of MenuGtk, as this menu does just too much weird stuff
with events to use the general class.
Review URL: http://codereview.chromium.org/115270
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/menu_gtk.h')
-rw-r--r-- | chrome/browser/gtk/menu_gtk.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/chrome/browser/gtk/menu_gtk.h b/chrome/browser/gtk/menu_gtk.h index b7afd67..24eef9a 100644 --- a/chrome/browser/gtk/menu_gtk.h +++ b/chrome/browser/gtk/menu_gtk.h @@ -51,8 +51,6 @@ class MenuGtk { void AppendMenuItemWithLabel(int command_id, const std::string& label); void AppendMenuItemWithIcon(int command_id, const std::string& label, const SkBitmap& icon); - MenuGtk* AppendSubMenuWithIcon(int command_id, const std::string& label, - const SkBitmap& icon); void AppendSeparator(); // Displays the menu. |timestamp| is the time of activation. The popup is @@ -82,6 +80,17 @@ class MenuGtk { static std::string ConvertAcceleratorsFromWindowsStyle( const std::string& label); + // Repositions the menu to be right under the button. Alignment is set as + // object data on |void_widget| with the tag "left_align". If "left_align" + // is true, it aligns the left side of the menu with the left side of the + // button. Otherwise it aligns the right side of the menu with the right side + // of the button. Public since some menus have odd requirements that don't + // belong in a public class. + static void MenuPositionFunc(GtkMenu* menu, + int* x, + int* y, + gboolean* push_in, + void* void_widget); private: // A recursive function that transforms a MenuCreateMaterial tree into a set // of GtkMenuItems. @@ -109,17 +118,6 @@ class MenuGtk { // via |delegate_|. static void OnMenuItemActivatedById(GtkMenuItem* menuitem, MenuGtk* menu); - // Repositions the menu to be right under the button. - // Alignment is set as object data on |void_widget| with the tag "left_align". - // If "left_align" is true, it aligns the left side of the menu with the left - // side of the button. Otherwise it aligns the right side of the menu with the - // right side of the button. - static void MenuPositionFunc(GtkMenu* menu, - int* x, - int* y, - gboolean* push_in, - void* void_widget); - // Sets the check mark and enabled/disabled state on our menu items. static void SetMenuItemInfo(GtkWidget* widget, void* raw_menu); @@ -134,10 +132,6 @@ class MenuGtk { // gtk_menu_popup() does not appear to take ownership of popup menus, so // MenuGtk explicitly manages the lifetime of the menu. OwnedWidgetGtk menu_; - - // MenuGtk instances of submenus; we keep references to these objects just to - // clean up during our destructor. - std::vector<MenuGtk*> children_; }; #endif // CHROME_BROWSER_GTK_MENU_GTK_H_ |