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 #include <set> | 10 #include <set> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 void UnregisterAll(ui::AcceleratorTarget* target); | 49 void UnregisterAll(ui::AcceleratorTarget* target); |
50 | 50 |
51 // Activates the target associated with the specified accelerator. | 51 // Activates the target associated with the specified accelerator. |
52 // First, AcceleratorPressed handler of the most recently registered target | 52 // First, AcceleratorPressed handler of the most recently registered target |
53 // is called, and if that handler processes the event (i.e. returns true), | 53 // is called, and if that handler processes the event (i.e. returns true), |
54 // this method immediately returns. If not, we do the same thing on the next | 54 // this method immediately returns. If not, we do the same thing on the next |
55 // target, and so on. | 55 // target, and so on. |
56 // Returns true if an accelerator was activated. | 56 // Returns true if an accelerator was activated. |
57 bool Process(const ui::Accelerator& accelerator); | 57 bool Process(const ui::Accelerator& accelerator); |
58 | 58 |
59 // Returns true if |accelerator| is one of the registered accelerators. | |
60 bool IsAccelerator(const ui::Accelerator& accelerator); | |
Ben Goodger (Google)
2012/05/01 16:00:37
IsRegistered()?
Yusuke Sato
2012/05/02 16:40:11
Removed the function.
| |
61 | |
59 // Overridden from ui::AcceleratorTarget: | 62 // Overridden from ui::AcceleratorTarget: |
60 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 63 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
61 virtual bool CanHandleAccelerators() const OVERRIDE; | 64 virtual bool CanHandleAccelerators() const OVERRIDE; |
62 | 65 |
63 void SetBrightnessControlDelegate( | 66 void SetBrightnessControlDelegate( |
64 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate); | 67 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate); |
65 void SetCapsLockDelegate(scoped_ptr<CapsLockDelegate> caps_lock_delegate); | 68 void SetCapsLockDelegate(scoped_ptr<CapsLockDelegate> caps_lock_delegate); |
66 void SetImeControlDelegate( | 69 void SetImeControlDelegate( |
67 scoped_ptr<ImeControlDelegate> ime_control_delegate); | 70 scoped_ptr<ImeControlDelegate> ime_control_delegate); |
68 void SetScreenshotDelegate( | 71 void SetScreenshotDelegate( |
(...skipping 29 matching lines...) Expand all Loading... | |
98 | 101 |
99 // Actions allowed when the user is not signed in or screen is locked | 102 // Actions allowed when the user is not signed in or screen is locked |
100 std::set<int> actions_allowed_at_login_screen_; | 103 std::set<int> actions_allowed_at_login_screen_; |
101 | 104 |
102 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 105 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
103 }; | 106 }; |
104 | 107 |
105 } // namespace ash | 108 } // namespace ash |
106 | 109 |
107 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 110 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
OLD | NEW |