OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |