| 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 "ui/events/keycodes/keyboard_codes.h" | 9 #include "ui/events/keycodes/keyboard_codes.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 public: | 48 public: |
| 49 virtual ~AcceleratorHandler() {} | 49 virtual ~AcceleratorHandler() {} |
| 50 | 50 |
| 51 virtual bool IsCommandEnabled(int command_id) const = 0; | 51 virtual bool IsCommandEnabled(int command_id) const = 0; |
| 52 virtual bool OnAcceleratorFired(int command_id, | 52 virtual bool OnAcceleratorFired(int command_id, |
| 53 const ui::Accelerator& accelerator) = 0; | 53 const ui::Accelerator& accelerator) = 0; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class AcceleratorManager { | 56 class AcceleratorManager { |
| 57 public: | 57 public: |
| 58 static AcceleratorManager* Get(); |
| 59 |
| 58 virtual ~AcceleratorManager() {} | 60 virtual ~AcceleratorManager() {} |
| 59 | 61 |
| 60 // Register accelerators and its handler that will be invoked when | 62 // Register accelerators and its handler that will be invoked when |
| 61 // one of accelerator is fired. | 63 // one of accelerator is fired. |
| 62 virtual void RegisterAccelerators(const AcceleratorData accelerators[], | 64 virtual void RegisterAccelerators(const AcceleratorData accelerators[], |
| 63 size_t num_accelerators, | 65 size_t num_accelerators, |
| 64 AcceleratorHandler* handler) = 0; | 66 AcceleratorHandler* handler) = 0; |
| 65 | 67 |
| 66 // Enables accelerators that has a AF_DEBUG flag. | 68 // Enables/Disables accelerators that has a AF_DEBUG flag. |
| 67 virtual void EnableDebugAccelerators() = 0; | 69 virtual void SetDebugAcceleratorsEnabled(bool enabled) = 0; |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace athena | 72 } // namespace athena |
| 71 | 73 |
| 72 #endif // ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ | 74 #endif // ATHENA_INPUT_PUBLIC_ACCELERATOR_MANAGER_H_ |
| OLD | NEW |