Don't preload rarely seen large images
[chromium-blink-merge.git] / ash / accelerators / accelerator_table.h
blob86ec31862888d1feb78e1579f71a0fd7c3f163ac
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
3 // found in the LICENSE file.
5 #ifndef ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
6 #define ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
8 #include "ash/ash_export.h"
9 #include "base/basictypes.h"
10 #include "ui/events/event_constants.h"
11 #include "ui/events/keycodes/keyboard_codes.h"
13 namespace ash {
15 // There are five classes of accelerators in Ash:
17 // Ash (OS) reserved:
18 // * Neither packaged apps nor web pages can cancel.
19 // * For example, power button.
20 // * See kReservedActions below.
22 // Ash (OS) preferred:
23 // * Fullscreen window can consume, but normal window can't.
24 // * For example, Alt-Tab window cycling.
25 // * See kPreferredActions below.
27 // Chrome OS system keys:
28 // * For legacy reasons, v1 apps can process and cancel. Otherwise handled
29 // directly by Ash.
30 // * Brightness, volume control, etc.
31 // * See IsSystemKey() in ash/accelerators/accelerator_filter.cc.
33 // Browser reserved:
34 // * Packaged apps can cancel but web pages cannot.
35 // * For example, browser back and forward from first-row function keys.
36 // * See IsReservedCommandOrKey() in
37 // chrome/browser/ui/browser_command_controller.cc.
39 // Browser non-reserved:
40 // * Both packaged apps and web pages can cancel.
41 // * For example, selecting tabs by number with Ctrl-1 to Ctrl-9.
42 // * See kAcceleratorMap in chrome/browser/ui/views/accelerator_table.cc.
44 // In particular, there is not an accelerator processing pass for Ash after
45 // the browser gets the accelerator. See crbug.com/285308 for details.
47 // There are also various restrictions on accelerators allowed at the login
48 // screen, when running in "forced app mode" (like a kiosk), etc. See the
49 // various kActionsAllowed* below.
51 // Please put if/def sections at the end of the bare section and keep the list
52 // within each section in alphabetical order.
53 enum AcceleratorAction {
54 CYCLE_BACKWARD_MRU,
55 CYCLE_FORWARD_MRU,
56 DEBUG_PRINT_LAYER_HIERARCHY,
57 DEBUG_PRINT_VIEW_HIERARCHY,
58 DEBUG_PRINT_WINDOW_HIERARCHY,
59 DEBUG_TOGGLE_ROOT_WINDOW_FULL_SCREEN,
60 DEBUG_TOGGLE_DESKTOP_BACKGROUND_MODE,
61 DEBUG_TOGGLE_DEVICE_SCALE_FACTOR,
62 DEBUG_TOGGLE_SHOW_DEBUG_BORDERS,
63 DEBUG_TOGGLE_SHOW_FPS_COUNTER,
64 DEBUG_TOGGLE_SHOW_PAINT_RECTS,
65 EXIT,
66 FOCUS_NEXT_PANE,
67 FOCUS_PREVIOUS_PANE,
68 FOCUS_SHELF,
69 LAUNCH_APP_0,
70 LAUNCH_APP_1,
71 LAUNCH_APP_2,
72 LAUNCH_APP_3,
73 LAUNCH_APP_4,
74 LAUNCH_APP_5,
75 LAUNCH_APP_6,
76 LAUNCH_APP_7,
77 LAUNCH_LAST_APP,
78 MAGNIFY_SCREEN_ZOOM_IN,
79 MAGNIFY_SCREEN_ZOOM_OUT,
80 MEDIA_NEXT_TRACK,
81 MEDIA_PLAY_PAUSE,
82 MEDIA_PREV_TRACK,
83 NEW_INCOGNITO_WINDOW,
84 NEW_TAB,
85 NEW_WINDOW,
86 NEXT_IME,
87 OPEN_FEEDBACK_PAGE,
88 PREVIOUS_IME,
89 PRINT_UI_HIERARCHIES,
90 RESTORE_TAB,
91 ROTATE_SCREEN,
92 ROTATE_WINDOW,
93 SCALE_UI_DOWN,
94 SCALE_UI_RESET,
95 SCALE_UI_UP,
96 SHOW_KEYBOARD_OVERLAY,
97 SHOW_MESSAGE_CENTER_BUBBLE,
98 SHOW_SYSTEM_TRAY_BUBBLE,
99 SHOW_TASK_MANAGER,
100 SWITCH_IME, // Switch to another IME depending on the accelerator.
101 TAKE_PARTIAL_SCREENSHOT,
102 TAKE_SCREENSHOT,
103 TOGGLE_APP_LIST,
104 TOGGLE_FULLSCREEN,
105 TOGGLE_MAXIMIZED,
106 TOGGLE_OVERVIEW,
107 WINDOW_MINIMIZE,
108 WINDOW_POSITION_CENTER,
109 WINDOW_CYCLE_SNAP_DOCK_LEFT,
110 WINDOW_CYCLE_SNAP_DOCK_RIGHT,
111 #if defined(OS_CHROMEOS)
112 BRIGHTNESS_DOWN,
113 BRIGHTNESS_UP,
114 DEBUG_ADD_REMOVE_DISPLAY,
115 DISABLE_CAPS_LOCK,
116 DISABLE_GPU_WATCHDOG,
117 KEYBOARD_BRIGHTNESS_DOWN,
118 KEYBOARD_BRIGHTNESS_UP,
119 LOCK_PRESSED,
120 LOCK_RELEASED,
121 LOCK_SCREEN,
122 OPEN_CROSH,
123 OPEN_FILE_MANAGER,
124 OPEN_GET_HELP,
125 POWER_PRESSED,
126 POWER_RELEASED,
127 SILENCE_SPOKEN_FEEDBACK,
128 SWAP_PRIMARY_DISPLAY,
129 SWITCH_TO_NEXT_USER,
130 SWITCH_TO_PREVIOUS_USER,
131 TOGGLE_CAPS_LOCK,
132 TOGGLE_MIRROR_MODE,
133 TOGGLE_SPOKEN_FEEDBACK,
134 TOGGLE_TOUCH_VIEW_TESTING,
135 TOGGLE_WIFI,
136 TOUCH_HUD_CLEAR,
137 TOUCH_HUD_MODE_CHANGE,
138 TOUCH_HUD_PROJECTION_TOGGLE,
139 VOLUME_DOWN,
140 VOLUME_MUTE,
141 VOLUME_UP,
142 #else
143 DUMMY_FOR_RESERVED,
144 #endif
147 struct AcceleratorData {
148 bool trigger_on_press;
149 ui::KeyboardCode keycode;
150 int modifiers;
151 AcceleratorAction action;
154 // Accelerators handled by AcceleratorController.
155 ASH_EXPORT extern const AcceleratorData kAcceleratorData[];
156 ASH_EXPORT extern const size_t kAcceleratorDataLength;
158 // Debug accelerators. Debug accelerators are only enabled when the "Debugging
159 // keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions
160 // are always run (similar to reserved actions).
161 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[];
162 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength;
164 // Actions that should be handled very early in Ash unless the current target
165 // window is full-screen.
166 ASH_EXPORT extern const AcceleratorAction kPreferredActions[];
167 ASH_EXPORT extern const size_t kPreferredActionsLength;
169 // Actions that are always handled in Ash.
170 ASH_EXPORT extern const AcceleratorAction kReservedActions[];
171 ASH_EXPORT extern const size_t kReservedActionsLength;
173 // Actions allowed while user is not signed in or screen is locked.
174 ASH_EXPORT extern const AcceleratorAction kActionsAllowedAtLoginOrLockScreen[];
175 ASH_EXPORT extern const size_t kActionsAllowedAtLoginOrLockScreenLength;
177 // Actions allowed while screen is locked (in addition to
178 // kActionsAllowedAtLoginOrLockScreen).
179 ASH_EXPORT extern const AcceleratorAction kActionsAllowedAtLockScreen[];
180 ASH_EXPORT extern const size_t kActionsAllowedAtLockScreenLength;
182 // Actions allowed while a modal window is up.
183 ASH_EXPORT extern const AcceleratorAction kActionsAllowedAtModalWindow[];
184 ASH_EXPORT extern const size_t kActionsAllowedAtModalWindowLength;
186 // Actions which will not be repeated while holding an accelerator key.
187 ASH_EXPORT extern const AcceleratorAction kNonrepeatableActions[];
188 ASH_EXPORT extern const size_t kNonrepeatableActionsLength;
190 // Actions allowed in app mode.
191 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[];
192 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength;
194 // Actions that require at least 1 window.
195 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[];
196 ASH_EXPORT extern const size_t kActionsNeedingWindowLength;
198 } // namespace ash
200 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_