diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 17:55:40 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 17:55:40 +0000 |
commit | 9d8ad763d1cc3b0665f6feb9bf66b4f6480a4ace (patch) | |
tree | ba305bd7e284e3fc6362478511bec15cc74b9db6 /chrome/browser/gtk/menu_gtk.h | |
parent | 66556c41055ac04e7adbbf47b2578e2ca389a1be (diff) | |
download | chromium_src-9d8ad763d1cc3b0665f6feb9bf66b4f6480a4ace.zip chromium_src-9d8ad763d1cc3b0665f6feb9bf66b4f6480a4ace.tar.gz chromium_src-9d8ad763d1cc3b0665f6feb9bf66b4f6480a4ace.tar.bz2 |
Activate download shelf button while the menu is showing.
TEST=download something. Press the down arrow button on the right of the item. A menu should popup and the button should appear to depress. The button should pop back when you close the menu (either by clicking away from it or by choosing an item in it).
Review URL: http://codereview.chromium.org/113684
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/menu_gtk.h')
-rw-r--r-- | chrome/browser/gtk/menu_gtk.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/chrome/browser/gtk/menu_gtk.h b/chrome/browser/gtk/menu_gtk.h index 24eef9a..53a48fe 100644 --- a/chrome/browser/gtk/menu_gtk.h +++ b/chrome/browser/gtk/menu_gtk.h @@ -30,6 +30,11 @@ class MenuGtk { // Executes the command. virtual void ExecuteCommand(int command_id) = 0; + // Called when the menu stops showing. This will be called along with + // ExecuteCommand if the user clicks an item, but will also be called when + // the user clicks away from the menu. + virtual void StoppedShowing() { }; + // Functions needed for creation of non-static menus. virtual int GetItemCount() const { return 0; } virtual bool IsItemSeparator(int command_id) const { return false; } @@ -47,6 +52,9 @@ class MenuGtk { MenuGtk(MenuGtk::Delegate* delegate, bool load); ~MenuGtk(); + // Initialize GTK signal handlers. + void ConnectSignalHandlers(); + // These methods are used to build the menu dynamically. void AppendMenuItemWithLabel(int command_id, const std::string& label); void AppendMenuItemWithIcon(int command_id, const std::string& label, @@ -70,11 +78,6 @@ class MenuGtk { // Closes the menu. void Cancel(); - // Sets an icon for an item with a given item_id. This method searches both - // this MenuGtk object and all child submenus. Returns false if the item with - // |item_id| is not found. - bool SetIcon(const SkBitmap& icon, int item_id); - // Change windows accelerator style to GTK style. (GTK uses _ for // accelerators. Windows uses & with && as an escape for &.) static std::string ConvertAcceleratorsFromWindowsStyle( @@ -91,6 +94,7 @@ class MenuGtk { int* y, gboolean* push_in, void* void_widget); + private: // A recursive function that transforms a MenuCreateMaterial tree into a set // of GtkMenuItems. @@ -121,6 +125,9 @@ class MenuGtk { // Sets the check mark and enabled/disabled state on our menu items. static void SetMenuItemInfo(GtkWidget* widget, void* raw_menu); + // Sets the activating widget back to a normal appearance. + static void OnMenuHidden(GtkWidget* widget, MenuGtk* menu); + // Queries this object about the menu state. MenuGtk::Delegate* delegate_; |