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_TABLE_H_ | 5 #ifndef ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ |
6 #define ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ | 6 #define ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
11 #include "ui/events/keycodes/keyboard_codes.h" | 11 #include "ui/events/keycodes/keyboard_codes.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 // There are four classes of accelerators in Ash: | 15 // There are five classes of accelerators in Ash: |
16 // | 16 // |
17 // Ash (OS) reserved: | 17 // Ash (OS) reserved: |
18 // * Neither packaged apps nor web pages can cancel. | 18 // * Neither packaged apps nor web pages can cancel. |
| 19 // * For example, power button. |
| 20 // * See kReservedActions below. |
| 21 // |
| 22 // Ash (OS) preferred: |
| 23 // * Fullscreen window can consume, but normal window can't. |
19 // * For example, Alt-Tab window cycling. | 24 // * For example, Alt-Tab window cycling. |
20 // * See kReservedActions below. | 25 // * See kPreferredActions below. |
21 // | 26 // |
22 // Chrome OS system keys: | 27 // Chrome OS system keys: |
23 // * For legacy reasons, v1 apps can process and cancel. Otherwise handled | 28 // * For legacy reasons, v1 apps can process and cancel. Otherwise handled |
24 // directly by Ash. | 29 // directly by Ash. |
25 // * Brightness, volume control, etc. | 30 // * Brightness, volume control, etc. |
26 // * See IsSystemKey() in ash/accelerators/accelerator_filter.cc. | 31 // * See IsSystemKey() in ash/accelerators/accelerator_filter.cc. |
27 // | 32 // |
28 // Browser reserved: | 33 // Browser reserved: |
29 // * Packaged apps can cancel but web pages cannot. | 34 // * Packaged apps can cancel but web pages cannot. |
30 // * For example, browser back and forward from first-row function keys. | 35 // * For example, browser back and forward from first-row function keys. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 WINDOW_SNAP_RIGHT, | 134 WINDOW_SNAP_RIGHT, |
130 #if defined(OS_CHROMEOS) | 135 #if defined(OS_CHROMEOS) |
131 ADD_REMOVE_DISPLAY, | 136 ADD_REMOVE_DISPLAY, |
132 TOGGLE_MIRROR_MODE, | 137 TOGGLE_MIRROR_MODE, |
133 DISABLE_GPU_WATCHDOG, | 138 DISABLE_GPU_WATCHDOG, |
134 LOCK_SCREEN, | 139 LOCK_SCREEN, |
135 OPEN_CROSH, | 140 OPEN_CROSH, |
136 OPEN_FILE_MANAGER, | 141 OPEN_FILE_MANAGER, |
137 SWITCH_TO_NEXT_USER, | 142 SWITCH_TO_NEXT_USER, |
138 SWITCH_TO_PREVIOUS_USER, | 143 SWITCH_TO_PREVIOUS_USER, |
| 144 #else |
| 145 DUMMY_FOR_RESERVED, |
139 #endif | 146 #endif |
140 }; | 147 }; |
141 | 148 |
142 struct AcceleratorData { | 149 struct AcceleratorData { |
143 bool trigger_on_press; | 150 bool trigger_on_press; |
144 ui::KeyboardCode keycode; | 151 ui::KeyboardCode keycode; |
145 int modifiers; | 152 int modifiers; |
146 AcceleratorAction action; | 153 AcceleratorAction action; |
147 }; | 154 }; |
148 | 155 |
149 // Accelerators handled by AcceleratorController. | 156 // Accelerators handled by AcceleratorController. |
150 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; | 157 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; |
151 ASH_EXPORT extern const size_t kAcceleratorDataLength; | 158 ASH_EXPORT extern const size_t kAcceleratorDataLength; |
152 | 159 |
153 #if !defined(NDEBUG) | 160 #if !defined(NDEBUG) |
154 // Accelerators useful when running on desktop. Debug build only. | 161 // Accelerators useful when running on desktop. Debug build only. |
155 ASH_EXPORT extern const AcceleratorData kDesktopAcceleratorData[]; | 162 ASH_EXPORT extern const AcceleratorData kDesktopAcceleratorData[]; |
156 ASH_EXPORT extern const size_t kDesktopAcceleratorDataLength; | 163 ASH_EXPORT extern const size_t kDesktopAcceleratorDataLength; |
157 #endif | 164 #endif |
158 | 165 |
159 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag | 166 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag |
160 // (--ash-debug-shortcuts) is enabled. | 167 // (--ash-debug-shortcuts) is enabled. |
161 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; | 168 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; |
162 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; | 169 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; |
163 | 170 |
164 // Actions that should be handled very early in Ash unless the current target | 171 // Actions that should be handled very early in Ash unless the current target |
165 // window is full-screen. | 172 // window is full-screen. |
| 173 ASH_EXPORT extern const AcceleratorAction kPreferredActions[]; |
| 174 ASH_EXPORT extern const size_t kPreferredActionsLength; |
| 175 |
| 176 // Actions that are always handled in Ash. |
166 ASH_EXPORT extern const AcceleratorAction kReservedActions[]; | 177 ASH_EXPORT extern const AcceleratorAction kReservedActions[]; |
167 ASH_EXPORT extern const size_t kReservedActionsLength; | 178 ASH_EXPORT extern const size_t kReservedActionsLength; |
168 | 179 |
169 // Actions that should be handled very early in Ash unless the current target | 180 // Actions that should be handled very early in Ash unless the current target |
170 // window is full-screen, these actions are only handled if | 181 // window is full-screen, these actions are only handled if |
171 // DebugShortcutsEnabled is true (command line switch 'ash-debug-shortcuts'). | 182 // DebugShortcutsEnabled is true (command line switch 'ash-debug-shortcuts'). |
172 ASH_EXPORT extern const AcceleratorAction kReservedDebugActions[]; | 183 ASH_EXPORT extern const AcceleratorAction kReservedDebugActions[]; |
173 ASH_EXPORT extern const size_t kReservedDebugActionsLength; | 184 ASH_EXPORT extern const size_t kReservedDebugActionsLength; |
174 | 185 |
175 // Actions allowed while user is not signed in or screen is locked. | 186 // Actions allowed while user is not signed in or screen is locked. |
(...skipping 17 matching lines...) Expand all Loading... |
193 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[]; | 204 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[]; |
194 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength; | 205 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength; |
195 | 206 |
196 // Actions that require at least 1 window. | 207 // Actions that require at least 1 window. |
197 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[]; | 208 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[]; |
198 ASH_EXPORT extern const size_t kActionsNeedingWindowLength; | 209 ASH_EXPORT extern const size_t kActionsNeedingWindowLength; |
199 | 210 |
200 } // namespace ash | 211 } // namespace ash |
201 | 212 |
202 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ | 213 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ |
OLD | NEW |