Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: ash/common/accelerators/accelerator_table.h

Issue 2689143002: ash: Remove OS_CHROMEOS ifdefs from accelerator files (Closed)
Patch Set: rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_COMMON_ACCELERATORS_ACCELERATOR_TABLE_H_ 5 #ifndef ASH_COMMON_ACCELERATORS_ACCELERATOR_TABLE_H_
6 #define ASH_COMMON_ACCELERATORS_ACCELERATOR_TABLE_H_ 6 #define ASH_COMMON_ACCELERATORS_ACCELERATOR_TABLE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // In particular, there is not an accelerator processing pass for Ash after 45 // In particular, there is not an accelerator processing pass for Ash after
46 // the browser gets the accelerator. See crbug.com/285308 for details. 46 // the browser gets the accelerator. See crbug.com/285308 for details.
47 // 47 //
48 // There are also various restrictions on accelerators allowed at the login 48 // There are also various restrictions on accelerators allowed at the login
49 // screen, when running in "forced app mode" (like a kiosk), etc. See the 49 // screen, when running in "forced app mode" (like a kiosk), etc. See the
50 // various kActionsAllowed* below. 50 // various kActionsAllowed* below.
51 // 51 //
52 // Please put if/def sections at the end of the bare section and keep the list 52 // Please put if/def sections at the end of the bare section and keep the list
53 // within each section in alphabetical order. 53 // within each section in alphabetical order.
54 enum AcceleratorAction { 54 enum AcceleratorAction {
55 BRIGHTNESS_DOWN,
56 BRIGHTNESS_UP,
55 CYCLE_BACKWARD_MRU, 57 CYCLE_BACKWARD_MRU,
56 CYCLE_FORWARD_MRU, 58 CYCLE_FORWARD_MRU,
57 DEBUG_PRINT_LAYER_HIERARCHY, 59 DEBUG_PRINT_LAYER_HIERARCHY,
58 DEBUG_PRINT_VIEW_HIERARCHY, 60 DEBUG_PRINT_VIEW_HIERARCHY,
59 DEBUG_PRINT_WINDOW_HIERARCHY, 61 DEBUG_PRINT_WINDOW_HIERARCHY,
62 DEBUG_SHOW_TOAST,
60 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR, 63 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR,
61 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS, 64 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS,
62 DEBUG_TOGGLE_SHOW_FPS_COUNTER, 65 DEBUG_TOGGLE_SHOW_FPS_COUNTER,
63 DEBUG_TOGGLE_SHOW_PAINT_RECTS, 66 DEBUG_TOGGLE_SHOW_PAINT_RECTS,
67 DEBUG_TOGGLE_TOUCH_PAD,
68 DEBUG_TOGGLE_TOUCH_SCREEN,
69 DEBUG_TOGGLE_TOUCH_VIEW,
64 DEBUG_TOGGLE_WALLPAPER_MODE, 70 DEBUG_TOGGLE_WALLPAPER_MODE,
65 DEBUG_TRIGGER_CRASH, // Intentionally crash the ash process. 71 DEBUG_TRIGGER_CRASH, // Intentionally crash the ash process.
72 DEV_ADD_REMOVE_DISPLAY,
66 DEV_TOGGLE_ROOT_WINDOW_FULL_SCREEN, 73 DEV_TOGGLE_ROOT_WINDOW_FULL_SCREEN,
74 DEV_TOGGLE_UNIFIED_DESKTOP,
75 DISABLE_CAPS_LOCK,
67 EXIT, 76 EXIT,
68 FOCUS_NEXT_PANE, 77 FOCUS_NEXT_PANE,
69 FOCUS_PREVIOUS_PANE, 78 FOCUS_PREVIOUS_PANE,
70 FOCUS_SHELF, 79 FOCUS_SHELF,
80 KEYBOARD_BRIGHTNESS_DOWN,
81 KEYBOARD_BRIGHTNESS_UP,
71 LAUNCH_APP_0, 82 LAUNCH_APP_0,
72 LAUNCH_APP_1, 83 LAUNCH_APP_1,
73 LAUNCH_APP_2, 84 LAUNCH_APP_2,
74 LAUNCH_APP_3, 85 LAUNCH_APP_3,
75 LAUNCH_APP_4, 86 LAUNCH_APP_4,
76 LAUNCH_APP_5, 87 LAUNCH_APP_5,
77 LAUNCH_APP_6, 88 LAUNCH_APP_6,
78 LAUNCH_APP_7, 89 LAUNCH_APP_7,
79 LAUNCH_LAST_APP, 90 LAUNCH_LAST_APP,
91 LOCK_PRESSED,
92 LOCK_RELEASED,
93 LOCK_SCREEN,
80 MAGNIFY_SCREEN_ZOOM_IN, 94 MAGNIFY_SCREEN_ZOOM_IN,
81 MAGNIFY_SCREEN_ZOOM_OUT, 95 MAGNIFY_SCREEN_ZOOM_OUT,
82 MEDIA_NEXT_TRACK, 96 MEDIA_NEXT_TRACK,
83 MEDIA_PLAY_PAUSE, 97 MEDIA_PLAY_PAUSE,
84 MEDIA_PREV_TRACK, 98 MEDIA_PREV_TRACK,
85 NEW_INCOGNITO_WINDOW, 99 NEW_INCOGNITO_WINDOW,
86 NEW_TAB, 100 NEW_TAB,
87 NEW_WINDOW, 101 NEW_WINDOW,
88 NEXT_IME, 102 NEXT_IME,
103 OPEN_CROSH,
89 OPEN_FEEDBACK_PAGE, 104 OPEN_FEEDBACK_PAGE,
105 OPEN_FILE_MANAGER,
106 OPEN_GET_HELP,
107 POWER_PRESSED,
108 POWER_RELEASED,
90 PREVIOUS_IME, 109 PREVIOUS_IME,
91 PRINT_UI_HIERARCHIES, 110 PRINT_UI_HIERARCHIES,
92 RESTORE_TAB, 111 RESTORE_TAB,
93 ROTATE_SCREEN, 112 ROTATE_SCREEN,
94 ROTATE_WINDOW, 113 ROTATE_WINDOW,
95 SCALE_UI_DOWN, 114 SCALE_UI_DOWN,
96 SCALE_UI_RESET, 115 SCALE_UI_RESET,
97 SCALE_UI_UP, 116 SCALE_UI_UP,
117 SHOW_IME_MENU_BUBBLE,
98 SHOW_KEYBOARD_OVERLAY, 118 SHOW_KEYBOARD_OVERLAY,
99 SHOW_MESSAGE_CENTER_BUBBLE, 119 SHOW_MESSAGE_CENTER_BUBBLE,
120 SHOW_STYLUS_TOOLS,
100 SHOW_SYSTEM_TRAY_BUBBLE, 121 SHOW_SYSTEM_TRAY_BUBBLE,
101 SHOW_TASK_MANAGER, 122 SHOW_TASK_MANAGER,
123 SUSPEND,
124 SWAP_PRIMARY_DISPLAY,
102 SWITCH_IME, // Switch to another IME depending on the accelerator. 125 SWITCH_IME, // Switch to another IME depending on the accelerator.
103 TAKE_WINDOW_SCREENSHOT, 126 SWITCH_TO_NEXT_USER,
127 SWITCH_TO_PREVIOUS_USER,
104 TAKE_PARTIAL_SCREENSHOT, 128 TAKE_PARTIAL_SCREENSHOT,
105 TAKE_SCREENSHOT, 129 TAKE_SCREENSHOT,
130 TAKE_WINDOW_SCREENSHOT,
106 TOGGLE_APP_LIST, 131 TOGGLE_APP_LIST,
132 TOGGLE_CAPS_LOCK,
107 TOGGLE_FULLSCREEN, 133 TOGGLE_FULLSCREEN,
134 TOGGLE_HIGH_CONTRAST,
108 TOGGLE_MAXIMIZED, 135 TOGGLE_MAXIMIZED,
136 TOGGLE_MIRROR_MODE,
109 TOGGLE_OVERVIEW, 137 TOGGLE_OVERVIEW,
110 UNPIN,
111 WINDOW_MINIMIZE,
112 WINDOW_POSITION_CENTER,
113 WINDOW_CYCLE_SNAP_DOCK_LEFT,
114 WINDOW_CYCLE_SNAP_DOCK_RIGHT,
115 #if defined(OS_CHROMEOS)
116 BRIGHTNESS_DOWN,
117 BRIGHTNESS_UP,
118 DEBUG_SHOW_TOAST,
119 DEBUG_TOGGLE_TOUCH_PAD,
120 DEBUG_TOGGLE_TOUCH_SCREEN,
121 DEBUG_TOGGLE_TOUCH_VIEW,
122 DEV_ADD_REMOVE_DISPLAY,
123 DEV_TOGGLE_UNIFIED_DESKTOP,
124 DISABLE_CAPS_LOCK,
125 KEYBOARD_BRIGHTNESS_DOWN,
126 KEYBOARD_BRIGHTNESS_UP,
127 LOCK_PRESSED,
128 LOCK_RELEASED,
129 LOCK_SCREEN,
130 OPEN_CROSH,
131 OPEN_FILE_MANAGER,
132 OPEN_GET_HELP,
133 POWER_PRESSED,
134 POWER_RELEASED,
135 SHOW_IME_MENU_BUBBLE,
136 SUSPEND,
137 SHOW_STYLUS_TOOLS,
138 SWAP_PRIMARY_DISPLAY,
139 SWITCH_TO_NEXT_USER,
140 SWITCH_TO_PREVIOUS_USER,
141 TOGGLE_CAPS_LOCK,
142 TOGGLE_HIGH_CONTRAST,
143 TOGGLE_MIRROR_MODE,
144 TOGGLE_SPOKEN_FEEDBACK, 138 TOGGLE_SPOKEN_FEEDBACK,
145 TOGGLE_WIFI, 139 TOGGLE_WIFI,
146 TOUCH_HUD_CLEAR, 140 TOUCH_HUD_CLEAR,
147 TOUCH_HUD_MODE_CHANGE, 141 TOUCH_HUD_MODE_CHANGE,
148 TOUCH_HUD_PROJECTION_TOGGLE, 142 TOUCH_HUD_PROJECTION_TOGGLE,
143 UNPIN,
149 VOLUME_DOWN, 144 VOLUME_DOWN,
150 VOLUME_MUTE, 145 VOLUME_MUTE,
151 VOLUME_UP, 146 VOLUME_UP,
152 #else 147 WINDOW_CYCLE_SNAP_DOCK_LEFT,
153 DUMMY_FOR_RESERVED, 148 WINDOW_CYCLE_SNAP_DOCK_RIGHT,
154 #endif 149 WINDOW_MINIMIZE,
150 WINDOW_POSITION_CENTER,
155 }; 151 };
156 152
157 struct AcceleratorData { 153 struct AcceleratorData {
158 bool trigger_on_press; 154 bool trigger_on_press;
159 ui::KeyboardCode keycode; 155 ui::KeyboardCode keycode;
160 int modifiers; 156 int modifiers;
161 AcceleratorAction action; 157 AcceleratorAction action;
162 }; 158 };
163 159
164 // Gathers the needed data to handle deprecated accelerators. 160 // Gathers the needed data to handle deprecated accelerators.
(...skipping 25 matching lines...) Expand all
190 enum DeprecatedAcceleratorUsage { 186 enum DeprecatedAcceleratorUsage {
191 DEPRECATED_USED = 0, // The deprecated accelerator is used. 187 DEPRECATED_USED = 0, // The deprecated accelerator is used.
192 NEW_USED, // The new accelerator is used. 188 NEW_USED, // The new accelerator is used.
193 DEPRECATED_USAGE_COUNT, // Maximum value of this enum for histogram use. 189 DEPRECATED_USAGE_COUNT, // Maximum value of this enum for histogram use.
194 }; 190 };
195 191
196 // Accelerators handled by AcceleratorController. 192 // Accelerators handled by AcceleratorController.
197 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; 193 ASH_EXPORT extern const AcceleratorData kAcceleratorData[];
198 ASH_EXPORT extern const size_t kAcceleratorDataLength; 194 ASH_EXPORT extern const size_t kAcceleratorDataLength;
199 195
200 #if defined(OS_CHROMEOS)
201 // The list of the deprecated accelerators. 196 // The list of the deprecated accelerators.
202 ASH_EXPORT extern const AcceleratorData kDeprecatedAccelerators[]; 197 ASH_EXPORT extern const AcceleratorData kDeprecatedAccelerators[];
203 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsLength; 198 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsLength;
204 199
205 // The list of the actions with deprecated accelerators and the needed data to 200 // The list of the actions with deprecated accelerators and the needed data to
206 // handle them. 201 // handle them.
207 ASH_EXPORT extern const DeprecatedAcceleratorData kDeprecatedAcceleratorsData[]; 202 ASH_EXPORT extern const DeprecatedAcceleratorData kDeprecatedAcceleratorsData[];
208 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsDataLength; 203 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsDataLength;
209 #endif // defined(OS_CHROMEOS)
210 204
211 // Debug accelerators. Debug accelerators are only enabled when the "Debugging 205 // Debug accelerators. Debug accelerators are only enabled when the "Debugging
212 // keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions 206 // keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions
213 // are always run (similar to reserved actions). Debug accelerators can be 207 // are always run (similar to reserved actions). Debug accelerators can be
214 // enabled in about:flags. 208 // enabled in about:flags.
215 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; 209 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[];
216 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; 210 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength;
217 211
218 // Developer accelerators that are enabled only with the command-line switch 212 // Developer accelerators that are enabled only with the command-line switch
219 // --ash-dev-shortcuts. They are always run similar to reserved actions. 213 // --ash-dev-shortcuts. They are always run similar to reserved actions.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[]; 255 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[];
262 ASH_EXPORT extern const size_t kActionsNeedingWindowLength; 256 ASH_EXPORT extern const size_t kActionsNeedingWindowLength;
263 257
264 // Actions that can be performed while keeping the menu open. 258 // Actions that can be performed while keeping the menu open.
265 ASH_EXPORT extern const AcceleratorAction kActionsKeepingMenuOpen[]; 259 ASH_EXPORT extern const AcceleratorAction kActionsKeepingMenuOpen[];
266 ASH_EXPORT extern const size_t kActionsKeepingMenuOpenLength; 260 ASH_EXPORT extern const size_t kActionsKeepingMenuOpenLength;
267 261
268 } // namespace ash 262 } // namespace ash
269 263
270 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_TABLE_H_ 264 #endif // ASH_COMMON_ACCELERATORS_ACCELERATOR_TABLE_H_
OLDNEW
« no previous file with comments | « ash/common/accelerators/accelerator_router.cc ('k') | ash/common/accelerators/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698