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

Side by Side Diff: ui/base/models/button_menu_item_model.cc

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « ui/base/models/button_menu_item_model.h ('k') | ui/base/models/simple_menu_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/models/button_menu_item_model.h" 5 #include "ui/base/models/button_menu_item_model.h"
6 6
7 #include "ui/base/l10n/l10n_util.h" 7 #include "ui/base/l10n/l10n_util.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
11 bool ButtonMenuItemModel::Delegate::IsItemForCommandIdDynamic( 11 bool ButtonMenuItemModel::Delegate::IsItemForCommandIdDynamic(
12 int command_id) const { 12 int command_id) const {
13 return false; 13 return false;
14 } 14 }
15 15
16 base::string16 ButtonMenuItemModel::Delegate::GetLabelForCommandId( 16 base::string16 ButtonMenuItemModel::Delegate::GetLabelForCommandId(
17 int command_id) const { 17 int command_id) const {
18 return base::string16(); 18 return base::string16();
19 } 19 }
20 20
21 bool ButtonMenuItemModel::Delegate::IsCommandIdEnabled(int command_id) const { 21 bool ButtonMenuItemModel::Delegate::IsCommandIdEnabled(int command_id) const {
22 return true; 22 return true;
23 } 23 }
24 24
25 bool ButtonMenuItemModel::Delegate::DoesCommandIdDismissMenu( 25 bool ButtonMenuItemModel::Delegate::DoesCommandIdDismissMenu(
26 int command_id) const { 26 int command_id) const {
27 return true; 27 return true;
28 } 28 }
29 29
30 bool ButtonMenuItemModel::Delegate::GetAcceleratorForCommandId(
31 int command_id,
32 ui::Accelerator* accelerator) const {
33 return false;
34 }
35
30 struct ButtonMenuItemModel::Item { 36 struct ButtonMenuItemModel::Item {
31 int command_id; 37 int command_id;
32 ButtonType type; 38 ButtonType type;
33 base::string16 label; 39 base::string16 label;
34 int icon_idr; 40 int icon_idr;
35 bool part_of_group; 41 bool part_of_group;
36 }; 42 };
37 43
38 ButtonMenuItemModel::ButtonMenuItemModel( 44 ButtonMenuItemModel::ButtonMenuItemModel(
39 int string_id, 45 int string_id,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 141 }
136 142
137 bool ButtonMenuItemModel::DoesCommandIdDismissMenu(int command_id) const { 143 bool ButtonMenuItemModel::DoesCommandIdDismissMenu(int command_id) const {
138 if (delegate_) 144 if (delegate_)
139 return delegate_->DoesCommandIdDismissMenu(command_id); 145 return delegate_->DoesCommandIdDismissMenu(command_id);
140 return true; 146 return true;
141 } 147 }
142 148
143 149
144 } // namespace ui 150 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/models/button_menu_item_model.h ('k') | ui/base/models/simple_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698