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

Unified Diff: chrome/browser/gtk/menu_gtk.cc

Issue 56184: Don't allow hotkeys to activate un-activatable menu items. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/menu_gtk.cc
===================================================================
--- chrome/browser/gtk/menu_gtk.cc (revision 12966)
+++ chrome/browser/gtk/menu_gtk.cc (working copy)
@@ -190,7 +190,9 @@
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 @@
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);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698