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

Side by Side Diff: ui/base/accelerators/accelerator.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/app_list/app_list_menu.cc ('k') | ui/base/cocoa/menu_controller_unittest.mm » ('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 // This class describe a keyboard accelerator (or keyboard shortcut). 5 // This class describe a keyboard accelerator (or keyboard shortcut).
6 // Keyboard accelerators are registered with the FocusManager. 6 // Keyboard accelerators are registered with the FocusManager.
7 // It has a copy constructor and assignment operator so that it can be copied. 7 // It has a copy constructor and assignment operator so that it can be copied.
8 // It also defines the < operator so that it can be used as a key in a std::map. 8 // It also defines the < operator so that it can be used as a key in a std::map.
9 // 9 //
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 virtual ~AcceleratorTarget() {} 111 virtual ~AcceleratorTarget() {}
112 }; 112 };
113 113
114 // Since accelerator code is one of the few things that can't be cross platform 114 // Since accelerator code is one of the few things that can't be cross platform
115 // in the chrome UI, separate out just the GetAcceleratorForCommandId() from 115 // in the chrome UI, separate out just the GetAcceleratorForCommandId() from
116 // the menu delegates. 116 // the menu delegates.
117 class AcceleratorProvider { 117 class AcceleratorProvider {
118 public: 118 public:
119 // Gets the accelerator for the specified command id. Returns true if the 119 // Gets the accelerator for the specified command id. Returns true if the
120 // command id has a valid accelerator, false otherwise. 120 // command id has a valid accelerator, false otherwise.
121 virtual bool GetAcceleratorForCommandId(int command_id, 121 virtual bool GetAcceleratorForCommandId(
122 ui::Accelerator* accelerator) = 0; 122 int command_id,
123 ui::Accelerator* accelerator) const = 0;
123 124
124 protected: 125 protected:
125 virtual ~AcceleratorProvider() {} 126 virtual ~AcceleratorProvider() {}
126 }; 127 };
127 128
128 } // namespace ui 129 } // namespace ui
129 130
130 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_ 131 #endif // UI_BASE_ACCELERATORS_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « ui/app_list/app_list_menu.cc ('k') | ui/base/cocoa/menu_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698