diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-02 19:20:38 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-02 19:20:38 +0000 |
commit | 1e465e817ab0d5d7ce776dfbd5e544e5d5aca22a (patch) | |
tree | 2d4e2cc297a4452147722ad78151427b5eb377b5 | |
parent | 3556799ffac342c53f707c151d813a6905063b12 (diff) | |
download | chromium_src-1e465e817ab0d5d7ce776dfbd5e544e5d5aca22a.zip chromium_src-1e465e817ab0d5d7ce776dfbd5e544e5d5aca22a.tar.gz chromium_src-1e465e817ab0d5d7ce776dfbd5e544e5d5aca22a.tar.bz2 |
Don't allow hotkeys to activate un-activatable menu items on linux.
BUG=9400
Review URL: http://codereview.chromium.org/56184
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13025 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/menu_gtk.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc index 47a89f9..dac60ab 100644 --- a/chrome/browser/gtk/menu_gtk.cc +++ b/chrome/browser/gtk/menu_gtk.cc @@ -190,7 +190,9 @@ void MenuGtk::OnMenuItemActivated(GtkMenuItem* menuitem, MenuGtk* menu) { const MenuCreateMaterial* data = reinterpret_cast<const MenuCreateMaterial*>( g_object_get_data(G_OBJECT(menuitem), "menu-data")); - menu->delegate_->ExecuteCommand(data->id); + // The menu item can still be activated by hotkeys even if it is disabled. + if (menu->delegate_->IsCommandEnabled(data->id)) + menu->delegate_->ExecuteCommand(data->id); } } @@ -201,7 +203,9 @@ void MenuGtk::OnMenuItemActivatedById(GtkMenuItem* menuitem, MenuGtk* menu) { if (!gtk_menu_item_get_submenu(menuitem)) { int id = reinterpret_cast<int>( g_object_get_data(G_OBJECT(menuitem), "menu-id")); - menu->delegate_->ExecuteCommand(id); + // The menu item can still be activated by hotkeys even if it is disabled. + if (menu->delegate_->IsCommandEnabled(id)) + menu->delegate_->ExecuteCommand(id); } } |