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 ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_ | 5 #ifndef ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_ |
6 #define ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_ | 6 #define ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "ui/wm/core/accelerator_delegate.h" | 13 #include "ui/wm/core/accelerator_delegate.h" |
12 | 14 |
13 namespace ash { | 15 namespace ash { |
14 | 16 |
| 17 class AcceleratorRouter; |
| 18 |
15 class ASH_EXPORT AcceleratorDelegate | 19 class ASH_EXPORT AcceleratorDelegate |
16 : NON_EXPORTED_BASE(public ::wm::AcceleratorDelegate) { | 20 : NON_EXPORTED_BASE(public ::wm::AcceleratorDelegate) { |
17 public: | 21 public: |
18 AcceleratorDelegate(); | 22 AcceleratorDelegate(); |
19 ~AcceleratorDelegate() override; | 23 ~AcceleratorDelegate() override; |
20 | 24 |
21 // wm::AcceleratorDelegate: | 25 // wm::AcceleratorDelegate: |
22 bool ProcessAccelerator(const ui::KeyEvent& event, | 26 bool ProcessAccelerator(const ui::KeyEvent& event, |
23 const ui::Accelerator& accelerator) override; | 27 const ui::Accelerator& accelerator) override; |
24 | 28 |
25 private: | 29 private: |
26 // Returns true if the window should be allowed a chance to handle | 30 std::unique_ptr<AcceleratorRouter> router_; |
27 // system keys. | |
28 bool CanConsumeSystemKeys(const ui::KeyEvent& event); | |
29 | |
30 bool ShouldProcessAcceleratorNow(const ui::KeyEvent& event, | |
31 const ui::Accelerator& accelerator); | |
32 | 31 |
33 DISALLOW_COPY_AND_ASSIGN(AcceleratorDelegate); | 32 DISALLOW_COPY_AND_ASSIGN(AcceleratorDelegate); |
34 }; | 33 }; |
35 | 34 |
36 } // namespace ash | 35 } // namespace ash |
37 | 36 |
38 #endif // ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_ | 37 #endif // ASH_ACCELERATORS_ACCELERATOR_DELEGATE_H_ |
OLD | NEW |