OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_AURA_SHELL_SHELL_ACCELERATOR_CONTROLLER_H_ | 5 #ifndef UI_AURA_SHELL_SHELL_ACCELERATOR_CONTROLLER_H_ |
6 #define UI_AURA_SHELL_SHELL_ACCELERATOR_CONTROLLER_H_ | 6 #define UI_AURA_SHELL_SHELL_ACCELERATOR_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | |
10 | |
9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
12 #include "ui/aura_shell/aura_shell_export.h" | 14 #include "ui/aura_shell/aura_shell_export.h" |
13 #include "ui/base/models/accelerator.h" | 15 #include "ui/base/models/accelerator.h" |
14 | 16 |
15 namespace ui { | 17 namespace ui { |
16 class AcceleratorManager; | 18 class AcceleratorManager; |
17 } // namespace ui | 19 } // namespace ui |
18 | 20 |
(...skipping 26 matching lines...) Expand all Loading... | |
45 // is called, and if that handler processes the event (i.e. returns true), | 47 // is called, and if that handler processes the event (i.e. returns true), |
46 // this method immediately returns. If not, we do the same thing on the next | 48 // this method immediately returns. If not, we do the same thing on the next |
47 // target, and so on. | 49 // target, and so on. |
48 // Returns true if an accelerator was activated. | 50 // Returns true if an accelerator was activated. |
49 bool Process(const ui::Accelerator& accelerator); | 51 bool Process(const ui::Accelerator& accelerator); |
50 | 52 |
51 // Overridden from ui::AcceleratorTarget: | 53 // Overridden from ui::AcceleratorTarget: |
52 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 54 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
53 | 55 |
54 private: | 56 private: |
57 // Initialize the accelerators this class handles as a target. | |
58 void Init(); | |
59 | |
55 scoped_ptr<ui::AcceleratorManager> accelerator_manager_; | 60 scoped_ptr<ui::AcceleratorManager> accelerator_manager_; |
61 std::map<ui::Accelerator, int> accelerators_; | |
Daniel Erat
2011/11/28 16:39:54
add a comment describing what the int value repres
mazda
2011/11/29 15:19:35
Done.
| |
56 | 62 |
57 DISALLOW_COPY_AND_ASSIGN(ShellAcceleratorController); | 63 DISALLOW_COPY_AND_ASSIGN(ShellAcceleratorController); |
58 }; | 64 }; |
59 | 65 |
60 } // namespace aura_shell | 66 } // namespace aura_shell |
61 | 67 |
62 #endif // UI_AURA_SHELL_SHELL_ACCELERATOR_CONTROLLER_H_ | 68 #endif // UI_AURA_SHELL_SHELL_ACCELERATOR_CONTROLLER_H_ |
OLD | NEW |