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

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

Issue 2133013002: AcceleratorProvider: Make GetAcceleratorForCommandId const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix overrides on Mac and Chrome OS. Created 4 years, 5 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/cocoa/menu_controller_unittest.mm ('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 #ifndef UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ 5 #ifndef UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_
6 #define UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ 6 #define UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 21 matching lines...) Expand all
32 virtual bool IsItemForCommandIdDynamic(int command_id) const; 32 virtual bool IsItemForCommandIdDynamic(int command_id) const;
33 virtual base::string16 GetLabelForCommandId(int command_id) const; 33 virtual base::string16 GetLabelForCommandId(int command_id) const;
34 34
35 // Performs the action associated with the specified command id. 35 // Performs the action associated with the specified command id.
36 virtual void ExecuteCommand(int command_id, int event_flags) = 0; 36 virtual void ExecuteCommand(int command_id, int event_flags) = 0;
37 virtual bool IsCommandIdEnabled(int command_id) const; 37 virtual bool IsCommandIdEnabled(int command_id) const;
38 virtual bool DoesCommandIdDismissMenu(int command_id) const; 38 virtual bool DoesCommandIdDismissMenu(int command_id) const;
39 39
40 // Gets the accelerator for the specified command id. Returns true if the 40 // Gets the accelerator for the specified command id. Returns true if the
41 // command id has a valid accelerator, false otherwise. 41 // command id has a valid accelerator, false otherwise.
42 virtual bool GetAcceleratorForCommandId(int command_id, 42 virtual bool GetAcceleratorForCommandId(
43 ui::Accelerator* accelerator) = 0; 43 int command_id,
44 ui::Accelerator* accelerator) const = 0;
44 45
45 protected: 46 protected:
46 virtual ~Delegate() {} 47 virtual ~Delegate() {}
47 }; 48 };
48 49
49 ButtonMenuItemModel(int string_id, ButtonMenuItemModel::Delegate* delegate); 50 ButtonMenuItemModel(int string_id, ButtonMenuItemModel::Delegate* delegate);
50 ~ButtonMenuItemModel(); 51 ~ButtonMenuItemModel();
51 52
52 // Adds a button that will emit |command_id|. All buttons created through 53 // Adds a button that will emit |command_id|. All buttons created through
53 // this method will have the same size, based on the largest button. 54 // this method will have the same size, based on the largest button.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 std::vector<Item> items_; 117 std::vector<Item> items_;
117 118
118 Delegate* delegate_; 119 Delegate* delegate_;
119 120
120 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel); 121 DISALLOW_COPY_AND_ASSIGN(ButtonMenuItemModel);
121 }; 122 };
122 123
123 } // namespace ui 124 } // namespace ui
124 125
125 #endif // UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_ 126 #endif // UI_BASE_MODELS_BUTTON_MENU_ITEM_MODEL_H_
OLDNEW
« no previous file with comments | « ui/base/cocoa/menu_controller_unittest.mm ('k') | ui/base/models/simple_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698