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