| 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 #ifndef ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 5 #ifndef ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| 6 #define ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 6 #define ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "ash/ash_export.h" | 14 #include "ash/ash_export.h" |
| 15 #include "ui/aura/client/accelerator_client.h" |
| 15 #include "ui/base/accelerators/accelerator.h" | 16 #include "ui/base/accelerators/accelerator.h" |
| 16 | 17 |
| 17 namespace ui { | 18 namespace ui { |
| 18 class AcceleratorManager; | 19 class AcceleratorManager; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace ash { | 22 namespace ash { |
| 22 | 23 |
| 23 class ScreenshotDelegate; | 24 class ScreenshotDelegate; |
| 24 class CapsLockDelegate; | 25 class CapsLockDelegate; |
| 25 | 26 |
| 26 // AcceleratorController provides functions for registering or unregistering | 27 // AcceleratorController provides functions for registering or unregistering |
| 27 // global keyboard accelerators, which are handled earlier than any windows. It | 28 // global keyboard accelerators, which are handled earlier than any windows. It |
| 28 // also implements several handlers as an accelerator target. | 29 // also implements several handlers as an accelerator target. |
| 29 class ASH_EXPORT AcceleratorController : public ui::AcceleratorTarget { | 30 class ASH_EXPORT AcceleratorController : public aura::client::AcceleratorClient, |
| 31 public ui::AcceleratorTarget { |
| 30 public: | 32 public: |
| 31 AcceleratorController(); | 33 AcceleratorController(); |
| 32 virtual ~AcceleratorController(); | 34 virtual ~AcceleratorController(); |
| 33 | 35 |
| 34 // Register a global keyboard accelerator for the specified target. If | 36 // Register a global keyboard accelerator for the specified target. If |
| 35 // multiple targets are registered for an accelerator, a target registered | 37 // multiple targets are registered for an accelerator, a target registered |
| 36 // later has higher priority. | 38 // later has higher priority. |
| 37 void Register(const ui::Accelerator& accelerator, | 39 void Register(const ui::Accelerator& accelerator, |
| 38 ui::AcceleratorTarget* target); | 40 ui::AcceleratorTarget* target); |
| 39 | 41 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // A map from accelerators to the AcceleratorAction values, which are used in | 74 // A map from accelerators to the AcceleratorAction values, which are used in |
| 73 // the implementation. | 75 // the implementation. |
| 74 std::map<ui::Accelerator, int> accelerators_; | 76 std::map<ui::Accelerator, int> accelerators_; |
| 75 | 77 |
| 76 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 78 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 } // namespace ash | 81 } // namespace ash |
| 80 | 82 |
| 81 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 83 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
| OLD | NEW |