| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Sets the event type if the accelerator should be processed on an event | 54 // Sets the event type if the accelerator should be processed on an event |
| 55 // other than ui::ET_KEY_PRESSED. | 55 // other than ui::ET_KEY_PRESSED. |
| 56 void set_type(ui::EventType type) { type_ = type; } | 56 void set_type(ui::EventType type) { type_ = type; } |
| 57 ui::EventType type() const { return type_; } | 57 ui::EventType type() const { return type_; } |
| 58 | 58 |
| 59 int modifiers() const { return modifiers_; } | 59 int modifiers() const { return modifiers_; } |
| 60 | 60 |
| 61 bool IsShiftDown() const; | 61 bool IsShiftDown() const; |
| 62 bool IsCtrlDown() const; | 62 bool IsCtrlDown() const; |
| 63 bool IsAltDown() const; | 63 bool IsAltDown() const; |
| 64 bool IsAltGrDown() const; |
| 64 bool IsCmdDown() const; | 65 bool IsCmdDown() const; |
| 65 bool IsRepeat() const; | 66 bool IsRepeat() const; |
| 66 | 67 |
| 67 // Returns a string with the localized shortcut if any. | 68 // Returns a string with the localized shortcut if any. |
| 68 base::string16 GetShortcutText() const; | 69 base::string16 GetShortcutText() const; |
| 69 | 70 |
| 70 void set_platform_accelerator(std::unique_ptr<PlatformAccelerator> p) { | 71 void set_platform_accelerator(std::unique_ptr<PlatformAccelerator> p) { |
| 71 platform_accelerator_ = std::move(p); | 72 platform_accelerator_ = std::move(p); |
| 72 } | 73 } |
| 73 | 74 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 virtual bool GetAcceleratorForCommandId(int command_id, | 122 virtual bool GetAcceleratorForCommandId(int command_id, |
| 122 ui::Accelerator* accelerator) = 0; | 123 ui::Accelerator* accelerator) = 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 |