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

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

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 | « ui/base/models/button_menu_item_model.h ('k') | ui/views/controls/menu/menu_model_adapter.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.cc
diff --git a/ui/base/models/button_menu_item_model.cc b/ui/base/models/button_menu_item_model.cc
index 83bd9737b62d52780903fb041bd10e13a2fb74bf..dd05fe2640e982c09b2022f7b1b90d05dc9e0f87 100644
--- a/ui/base/models/button_menu_item_model.cc
+++ b/ui/base/models/button_menu_item_model.cc
@@ -88,6 +88,15 @@ bool ButtonMenuItemModel::IsItemDynamicAt(int index) const {
return false;
}
+bool ButtonMenuItemModel::GetAcceleratorAt(int index,
+ ui::Accelerator* accelerator) const {
+ if (delegate_) {
+ return delegate_->GetAcceleratorForCommandId(GetCommandIdAt(index),
+ accelerator);
+ }
+ return false;
+}
+
base::string16 ButtonMenuItemModel::GetLabelAt(int index) const {
if (IsItemDynamicAt(index))
return delegate_->GetLabelForCommandId(GetCommandIdAt(index));
@@ -106,9 +115,9 @@ bool ButtonMenuItemModel::PartOfGroup(int index) const {
return items_[index].part_of_group;
}
-void ButtonMenuItemModel::ActivatedCommand(int command_id) {
+void ButtonMenuItemModel::ActivatedAt(int index) {
if (delegate_)
- delegate_->ExecuteCommand(command_id, 0);
+ delegate_->ExecuteCommand(GetCommandIdAt(index), 0);
}
bool ButtonMenuItemModel::IsEnabledAt(int index) const {
« no previous file with comments | « ui/base/models/button_menu_item_model.h ('k') | ui/views/controls/menu/menu_model_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698