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/base/events/event_constants.h" | 10 #include "ui/base/events/event_constants.h" |
11 #include "ui/base/keycodes/keyboard_codes.h" | 11 #include "ui/base/keycodes/keyboard_codes.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 // Please put if/def sections at the end of the bare section and keep the list | 15 // Please put if/def sections at the end of the bare section and keep the list |
16 // within each section in alphabetical order. | 16 // within each section in alphabetical order. |
17 enum AcceleratorAction { | 17 enum AcceleratorAction { |
18 BRIGHTNESS_DOWN, | 18 BRIGHTNESS_DOWN, |
19 BRIGHTNESS_UP, | 19 BRIGHTNESS_UP, |
20 CYCLE_BACKWARD_LINEAR, | 20 CYCLE_BACKWARD_LINEAR, |
21 CYCLE_BACKWARD_MRU, | 21 CYCLE_BACKWARD_MRU, |
22 CYCLE_FORWARD_LINEAR, | 22 CYCLE_FORWARD_LINEAR, |
23 CYCLE_FORWARD_MRU, | 23 CYCLE_FORWARD_MRU, |
| 24 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR, |
| 25 DEBUG_TOGGLE_SHOW_PAINT_RECTS, |
24 DISABLE_CAPS_LOCK, | 26 DISABLE_CAPS_LOCK, |
25 DISPLAY_TOGGLE_SCALE, | |
26 EXIT, | 27 EXIT, |
27 FOCUS_LAUNCHER, | 28 FOCUS_LAUNCHER, |
28 FOCUS_NEXT_PANE, | 29 FOCUS_NEXT_PANE, |
29 FOCUS_PREVIOUS_PANE, | 30 FOCUS_PREVIOUS_PANE, |
30 KEYBOARD_BRIGHTNESS_DOWN, | 31 KEYBOARD_BRIGHTNESS_DOWN, |
31 KEYBOARD_BRIGHTNESS_UP, | 32 KEYBOARD_BRIGHTNESS_UP, |
32 LOCK_PRESSED, | 33 LOCK_PRESSED, |
33 LOCK_RELEASED, | 34 LOCK_RELEASED, |
34 MAGNIFY_SCREEN_ZOOM_IN, | 35 MAGNIFY_SCREEN_ZOOM_IN, |
35 MAGNIFY_SCREEN_ZOOM_OUT, | 36 MAGNIFY_SCREEN_ZOOM_OUT, |
36 MEDIA_NEXT_TRACK, | 37 MEDIA_NEXT_TRACK, |
37 MEDIA_PLAY_PAUSE, | 38 MEDIA_PLAY_PAUSE, |
38 MEDIA_PREV_TRACK, | 39 MEDIA_PREV_TRACK, |
39 NEW_INCOGNITO_WINDOW, | 40 NEW_INCOGNITO_WINDOW, |
40 NEW_TAB, | 41 NEW_TAB, |
41 NEW_WINDOW, | 42 NEW_WINDOW, |
42 NEXT_IME, | 43 NEXT_IME, |
43 OPEN_FEEDBACK_PAGE, | 44 OPEN_FEEDBACK_PAGE, |
44 PREVIOUS_IME, | |
45 POWER_PRESSED, | 45 POWER_PRESSED, |
46 POWER_RELEASED, | 46 POWER_RELEASED, |
| 47 PREVIOUS_IME, |
| 48 PRINT_LAYER_HIERARCHY, |
47 PRINT_UI_HIERARCHIES, | 49 PRINT_UI_HIERARCHIES, |
| 50 PRINT_VIEW_HIERARCHY, |
| 51 PRINT_WINDOW_HIERARCHY, |
48 RESTORE_TAB, | 52 RESTORE_TAB, |
49 ROTATE_SCREEN, | 53 ROTATE_SCREEN, |
50 ROTATE_WINDOW, | 54 ROTATE_WINDOW, |
51 SCALE_UI_DOWN, | 55 SCALE_UI_DOWN, |
52 SCALE_UI_RESET, | 56 SCALE_UI_RESET, |
53 SCALE_UI_UP, | 57 SCALE_UI_UP, |
54 SELECT_LAST_WIN, | 58 SELECT_LAST_WIN, |
55 SELECT_WIN_0, | 59 SELECT_WIN_0, |
56 SELECT_WIN_1, | 60 SELECT_WIN_1, |
57 SELECT_WIN_2, | 61 SELECT_WIN_2, |
(...skipping 24 matching lines...) Expand all Loading... |
82 TOUCH_HUD_MODE_CHANGE, | 86 TOUCH_HUD_MODE_CHANGE, |
83 VOLUME_DOWN, | 87 VOLUME_DOWN, |
84 VOLUME_MUTE, | 88 VOLUME_MUTE, |
85 VOLUME_UP, | 89 VOLUME_UP, |
86 WINDOW_MINIMIZE, | 90 WINDOW_MINIMIZE, |
87 WINDOW_POSITION_CENTER, | 91 WINDOW_POSITION_CENTER, |
88 WINDOW_SNAP_LEFT, | 92 WINDOW_SNAP_LEFT, |
89 WINDOW_SNAP_RIGHT, | 93 WINDOW_SNAP_RIGHT, |
90 #if defined(OS_CHROMEOS) | 94 #if defined(OS_CHROMEOS) |
91 CYCLE_DISPLAY_MODE, | 95 CYCLE_DISPLAY_MODE, |
| 96 DISABLE_GPU_WATCHDOG, |
92 LOCK_SCREEN, | 97 LOCK_SCREEN, |
93 OPEN_CROSH, | 98 OPEN_CROSH, |
94 OPEN_FILE_DIALOG, // Open 'Open file' dialog. | 99 OPEN_FILE_DIALOG, // Open 'Open file' dialog. |
95 OPEN_FILE_MANAGER, | 100 OPEN_FILE_MANAGER, |
96 DISABLE_GPU_WATCHDOG, | |
97 #endif | |
98 #if !defined(NDEBUG) | |
99 PRINT_LAYER_HIERARCHY, | |
100 PRINT_VIEW_HIERARCHY, | |
101 PRINT_WINDOW_HIERARCHY, | |
102 #endif | 101 #endif |
103 }; | 102 }; |
104 | 103 |
105 struct AcceleratorData { | 104 struct AcceleratorData { |
106 bool trigger_on_press; | 105 bool trigger_on_press; |
107 ui::KeyboardCode keycode; | 106 ui::KeyboardCode keycode; |
108 int modifiers; | 107 int modifiers; |
109 AcceleratorAction action; | 108 AcceleratorAction action; |
110 }; | 109 }; |
111 | 110 |
112 // Accelerators handled by AcceleratorController. | 111 // Accelerators handled by AcceleratorController. |
113 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; | 112 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; |
114 | 113 |
115 // The number of elements in kAcceleratorData. | 114 // The number of elements in kAcceleratorData. |
116 ASH_EXPORT extern const size_t kAcceleratorDataLength; | 115 ASH_EXPORT extern const size_t kAcceleratorDataLength; |
117 | 116 |
| 117 #if !defined(NDEBUG) |
| 118 // Accelerators useful when running on desktop. Debug build only. |
| 119 ASH_EXPORT extern const AcceleratorData kDesktopAcceleratorData[]; |
| 120 |
| 121 // The number of elements in kDesktopAcceleratorData. |
| 122 ASH_EXPORT extern const size_t kDesktopAcceleratorDataLength; |
| 123 #endif |
| 124 |
118 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag | 125 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag |
119 // (--ash-debug-shortcuts) is enabled. | 126 // (--ash-debug-shortcuts) is enabled. |
120 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; | 127 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; |
121 | 128 |
122 // The number of elements in kDebugAcceleratorData. | 129 // The number of elements in kDebugAcceleratorData. |
123 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; | 130 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; |
124 | 131 |
125 // Actions that should be handled very early in Ash unless the current target | 132 // Actions that should be handled very early in Ash unless the current target |
126 // window is full-screen. | 133 // window is full-screen. |
127 ASH_EXPORT extern const AcceleratorAction kReservedActions[]; | 134 ASH_EXPORT extern const AcceleratorAction kReservedActions[]; |
(...skipping 28 matching lines...) Expand all Loading... |
156 | 163 |
157 // Actions allowed in app mode. | 164 // Actions allowed in app mode. |
158 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[]; | 165 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[]; |
159 | 166 |
160 // The number of elements in kActionsAllowedInAppMode. | 167 // The number of elements in kActionsAllowedInAppMode. |
161 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength; | 168 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength; |
162 | 169 |
163 } // namespace ash | 170 } // namespace ash |
164 | 171 |
165 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ | 172 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ |
OLD | NEW |