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

Unified Diff: app/menus/button_menu_item_model.h

Issue 3026025: The Mac wrench menu zoom controls honor the global enabled state of the zoom commands. (Closed)
Patch Set: Removed unneeded disabling of percentage display. Created 10 years, 5 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 | app/menus/button_menu_item_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/menus/button_menu_item_model.h
diff --git a/app/menus/button_menu_item_model.h b/app/menus/button_menu_item_model.h
index 29a8b7c409b57ef8811511b449b2e69d8ba74cc6..8e3300ea522cee6d0e4a3dbaefc65d6c18061dec 100644
--- a/app/menus/button_menu_item_model.h
+++ b/app/menus/button_menu_item_model.h
@@ -31,6 +31,7 @@ class ButtonMenuItemModel {
// Performs the action associated with the specified command id.
virtual void ExecuteCommand(int command_id) = 0;
+ virtual bool IsCommandIdEnabled(int command_id) const { return true; }
};
ButtonMenuItemModel(int string_id, ButtonMenuItemModel::Delegate* delegate);
@@ -77,6 +78,9 @@ class ButtonMenuItemModel {
// Called from implementations.
void ActivatedCommand(int command_id);
+ // Returns the enabled state of the button at |index|.
+ bool IsEnabledAt(int index) const;
+
const string16& label() const { return item_label_; }
private:
« no previous file with comments | « no previous file | app/menus/button_menu_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698