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

Side by Side Diff: ui/base/models/simple_menu_model.h

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.cc ('k') | ui/base/models/simple_menu_model.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ 5 #ifndef UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_
6 #define UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ 6 #define UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 18 matching lines...) Expand all
29 class UI_BASE_EXPORT Delegate { 29 class UI_BASE_EXPORT Delegate {
30 public: 30 public:
31 virtual ~Delegate() {} 31 virtual ~Delegate() {}
32 32
33 // Methods for determining the state of specific command ids. 33 // Methods for determining the state of specific command ids.
34 virtual bool IsCommandIdChecked(int command_id) const = 0; 34 virtual bool IsCommandIdChecked(int command_id) const = 0;
35 virtual bool IsCommandIdEnabled(int command_id) const = 0; 35 virtual bool IsCommandIdEnabled(int command_id) const = 0;
36 virtual bool IsCommandIdVisible(int command_id) const; 36 virtual bool IsCommandIdVisible(int command_id) const;
37 37
38 // Gets the accelerator for the specified command id. Returns true if the 38 // Gets the accelerator for the specified command id. Returns true if the
39 // command id has a valid accelerator, false otherwise. 39 // command id has a valid accelerator, false otherwise. By default, returns
40 virtual bool GetAcceleratorForCommandId( 40 // false for all commands.
41 int command_id, 41 virtual bool GetAcceleratorForCommandId(int command_id,
42 ui::Accelerator* accelerator) const = 0; 42 ui::Accelerator* accelerator) const;
43 43
44 // Some command ids have labels, sublabels, minor text and icons that change 44 // Some command ids have labels, sublabels, minor text and icons that change
45 // over time. 45 // over time.
46 virtual bool IsItemForCommandIdDynamic(int command_id) const; 46 virtual bool IsItemForCommandIdDynamic(int command_id) const;
47 virtual base::string16 GetLabelForCommandId(int command_id) const; 47 virtual base::string16 GetLabelForCommandId(int command_id) const;
48 virtual base::string16 GetSublabelForCommandId(int command_id) const; 48 virtual base::string16 GetSublabelForCommandId(int command_id) const;
49 virtual base::string16 GetMinorTextForCommandId(int command_id) const; 49 virtual base::string16 GetMinorTextForCommandId(int command_id) const;
50 // Gets the icon for the item with the specified id, returning true if there 50 // Gets the icon for the item with the specified id, returning true if there
51 // is an icon, false otherwise. 51 // is an icon, false otherwise.
52 virtual bool GetIconForCommandId(int command_id, 52 virtual bool GetIconForCommandId(int command_id,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 MenuModelDelegate* menu_model_delegate_; 194 MenuModelDelegate* menu_model_delegate_;
195 195
196 base::WeakPtrFactory<SimpleMenuModel> method_factory_; 196 base::WeakPtrFactory<SimpleMenuModel> method_factory_;
197 197
198 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel); 198 DISALLOW_COPY_AND_ASSIGN(SimpleMenuModel);
199 }; 199 };
200 200
201 } // namespace ui 201 } // namespace ui
202 202
203 #endif // UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_ 203 #endif // UI_BASE_MODELS_SIMPLE_MENU_MODEL_H_
OLDNEW
« no previous file with comments | « ui/base/models/button_menu_item_model.cc ('k') | ui/base/models/simple_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698