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

Unified Diff: ui/base/models/button_menu_item_model.h

Issue 1003853004: MacViews: Gets wrench menu working (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@grd
Patch Set: Created 5 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 | « chrome/browser/ui/views/toolbar/wrench_menu.cc ('k') | ui/base/models/button_menu_item_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/models/button_menu_item_model.h
diff --git a/ui/base/models/button_menu_item_model.h b/ui/base/models/button_menu_item_model.h
index b0bc95bd03a260884e0f4dbb2dc8d10e3492e531..01666fe71556eeaa7996bddf23a46ea1fa4b059b 100644
--- a/ui/base/models/button_menu_item_model.h
+++ b/ui/base/models/button_menu_item_model.h
@@ -12,6 +12,8 @@
namespace ui {
+class Accelerator;
+
// A model representing the rows of buttons that should be inserted in a button
// containing menu item.
class UI_BASE_EXPORT ButtonMenuItemModel {
@@ -34,6 +36,11 @@ class UI_BASE_EXPORT ButtonMenuItemModel {
virtual bool IsCommandIdEnabled(int command_id) const;
virtual bool DoesCommandIdDismissMenu(int command_id) const;
+ // Gets the accelerator for the specified command id. Returns true if the
+ // command id has a valid accelerator, false otherwise.
+ virtual bool GetAcceleratorForCommandId(int command_id,
+ ui::Accelerator* accelerator) = 0;
+
protected:
virtual ~Delegate() {}
};
@@ -68,6 +75,10 @@ class UI_BASE_EXPORT ButtonMenuItemModel {
// Whether the label for item |index| changes.
bool IsItemDynamicAt(int index) const;
+ // Gets the accelerator information for the specified index, returning true if
+ // there is a shortcut accelerator for the item, false otherwise.
+ bool GetAcceleratorAt(int index, ui::Accelerator* accelerator) const;
+
// Returns the current label value for the button at |index|.
base::string16 GetLabelAt(int index) const;
@@ -79,8 +90,8 @@ class UI_BASE_EXPORT ButtonMenuItemModel {
// other items that have their PartOfGroup bit set.
bool PartOfGroup(int index) const;
- // Called from implementations.
- void ActivatedCommand(int command_id);
+ // Called when the item at the specified index has been activated.
+ void ActivatedAt(int index);
// Returns the enabled state of the button at |index|.
bool IsEnabledAt(int index) const;
« no previous file with comments | « chrome/browser/ui/views/toolbar/wrench_menu.cc ('k') | ui/base/models/button_menu_item_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698