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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 void SetBrightnessControlDelegate( | 76 void SetBrightnessControlDelegate( |
77 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate); | 77 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate); |
78 void SetCapsLockDelegate(scoped_ptr<CapsLockDelegate> caps_lock_delegate); | 78 void SetCapsLockDelegate(scoped_ptr<CapsLockDelegate> caps_lock_delegate); |
79 void SetImeControlDelegate( | 79 void SetImeControlDelegate( |
80 scoped_ptr<ImeControlDelegate> ime_control_delegate); | 80 scoped_ptr<ImeControlDelegate> ime_control_delegate); |
81 void SetKeyboardBrightnessControlDelegate( | 81 void SetKeyboardBrightnessControlDelegate( |
82 scoped_ptr<KeyboardBrightnessControlDelegate> | 82 scoped_ptr<KeyboardBrightnessControlDelegate> |
83 keyboard_brightness_control_delegate); | 83 keyboard_brightness_control_delegate); |
84 void SetScreenshotDelegate( | 84 void SetScreenshotDelegate( |
85 scoped_ptr<ScreenshotDelegate> screenshot_delegate); | 85 scoped_ptr<ScreenshotDelegate> screenshot_delegate); |
86 void SetVolumeControlDelegate( | |
87 scoped_ptr<VolumeControlDelegate> volume_control_delegate); | |
88 | |
89 BrightnessControlDelegate* brightness_control_delegate() const { | 86 BrightnessControlDelegate* brightness_control_delegate() const { |
90 return brightness_control_delegate_.get(); | 87 return brightness_control_delegate_.get(); |
91 } | 88 } |
92 | 89 |
93 VolumeControlDelegate* volume_control_delegate() const { | |
94 return volume_control_delegate_.get(); | |
95 } | |
96 | |
97 private: | 90 private: |
98 // Initializes the accelerators this class handles as a target. | 91 // Initializes the accelerators this class handles as a target. |
99 void Init(); | 92 void Init(); |
100 | 93 |
101 // Switches to a 0-indexed (in order of creation) window. | 94 // Switches to a 0-indexed (in order of creation) window. |
102 // A negative index switches to the last window in the list. | 95 // A negative index switches to the last window in the list. |
103 void SwitchToWindow(int window); | 96 void SwitchToWindow(int window); |
104 | 97 |
105 // Registers the specified accelerators. | 98 // Registers the specified accelerators. |
106 void RegisterAccelerators(const AcceleratorData accelerators[], | 99 void RegisterAccelerators(const AcceleratorData accelerators[], |
107 size_t accelerators_length); | 100 size_t accelerators_length); |
108 | 101 |
109 scoped_ptr<ui::AcceleratorManager> accelerator_manager_; | 102 scoped_ptr<ui::AcceleratorManager> accelerator_manager_; |
110 | 103 |
111 // TODO(derat): BrightnessControlDelegate is also used by the system tray; | 104 // TODO(derat): BrightnessControlDelegate is also used by the system tray; |
112 // move it outside of this class. | 105 // move it outside of this class. |
113 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate_; | 106 scoped_ptr<BrightnessControlDelegate> brightness_control_delegate_; |
114 scoped_ptr<CapsLockDelegate> caps_lock_delegate_; | 107 scoped_ptr<CapsLockDelegate> caps_lock_delegate_; |
115 scoped_ptr<ImeControlDelegate> ime_control_delegate_; | 108 scoped_ptr<ImeControlDelegate> ime_control_delegate_; |
116 scoped_ptr<KeyboardBrightnessControlDelegate> | 109 scoped_ptr<KeyboardBrightnessControlDelegate> |
117 keyboard_brightness_control_delegate_; | 110 keyboard_brightness_control_delegate_; |
118 scoped_ptr<ScreenshotDelegate> screenshot_delegate_; | 111 scoped_ptr<ScreenshotDelegate> screenshot_delegate_; |
119 scoped_ptr<VolumeControlDelegate> volume_control_delegate_; | |
120 | 112 |
121 // A map from accelerators to the AcceleratorAction values, which are used in | 113 // A map from accelerators to the AcceleratorAction values, which are used in |
122 // the implementation. | 114 // the implementation. |
123 std::map<ui::Accelerator, int> accelerators_; | 115 std::map<ui::Accelerator, int> accelerators_; |
124 | 116 |
125 // Actions allowed when the user is not signed in. | 117 // Actions allowed when the user is not signed in. |
126 std::set<int> actions_allowed_at_login_screen_; | 118 std::set<int> actions_allowed_at_login_screen_; |
127 // Actions allowed when the screen is locked. | 119 // Actions allowed when the screen is locked. |
128 std::set<int> actions_allowed_at_lock_screen_; | 120 std::set<int> actions_allowed_at_lock_screen_; |
129 // Reserved actions. See accelerator_table.h for details. | 121 // Reserved actions. See accelerator_table.h for details. |
130 std::set<int> reserved_actions_; | 122 std::set<int> reserved_actions_; |
131 | 123 |
132 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); | 124 DISALLOW_COPY_AND_ASSIGN(AcceleratorController); |
133 }; | 125 }; |
134 | 126 |
135 } // namespace ash | 127 } // namespace ash |
136 | 128 |
137 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ | 129 #endif // ASH_ACCELERATORS_ACCELERATOR_CONTROLLER_H_ |
OLD | NEW |