| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ | 5 #ifndef ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ |
| 6 #define ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ | 6 #define ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ |
| 7 | 7 |
| 8 #include "athena/athena_export.h" | 8 #include "athena/athena_export.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 public: | 53 public: |
| 54 virtual ~AcceleratorHandler() {} | 54 virtual ~AcceleratorHandler() {} |
| 55 | 55 |
| 56 virtual bool IsCommandEnabled(int command_id) const = 0; | 56 virtual bool IsCommandEnabled(int command_id) const = 0; |
| 57 virtual bool OnAcceleratorFired(int command_id, | 57 virtual bool OnAcceleratorFired(int command_id, |
| 58 const ui::Accelerator& accelerator) = 0; | 58 const ui::Accelerator& accelerator) = 0; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class ATHENA_EXPORT AcceleratorManager { | 61 class ATHENA_EXPORT AcceleratorManager { |
| 62 public: | 62 public: |
| 63 // Returns an AccelerarManager for global acelerators. | 63 // Returns an AcceleratorManager for global accelerators. |
| 64 static AcceleratorManager* Get(); | 64 static AcceleratorManager* Get(); |
| 65 | 65 |
| 66 // Creates an AcceleratorManager for application windows that | 66 // Creates an AcceleratorManager for application windows that |
| 67 // define their own accelerators. | 67 // define their own accelerators. |
| 68 static scoped_ptr<AcceleratorManager> CreateForFocusManager( | 68 static scoped_ptr<AcceleratorManager> CreateForFocusManager( |
| 69 views::FocusManager* focus_manager); | 69 views::FocusManager* focus_manager); |
| 70 | 70 |
| 71 virtual ~AcceleratorManager() {} | 71 virtual ~AcceleratorManager() {} |
| 72 | 72 |
| 73 // Tells if the accelerator is registered with the given flag. If | 73 // Tells if the accelerator is registered with the given flag. If |
| (...skipping 13 matching lines...) Expand all Loading... |
| 87 virtual void UnregisterAccelerator(const AcceleratorData& accelerator_data, | 87 virtual void UnregisterAccelerator(const AcceleratorData& accelerator_data, |
| 88 AcceleratorHandler* handler) = 0; | 88 AcceleratorHandler* handler) = 0; |
| 89 | 89 |
| 90 // Enables/Disables accelerators that has a AF_DEBUG flag. | 90 // Enables/Disables accelerators that has a AF_DEBUG flag. |
| 91 virtual void SetDebugAcceleratorsEnabled(bool enabled) = 0; | 91 virtual void SetDebugAcceleratorsEnabled(bool enabled) = 0; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace athena | 94 } // namespace athena |
| 95 | 95 |
| 96 #endif // ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ | 96 #endif // ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ |
| OLD | NEW |