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

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

Issue 582143004: Introduce "Preferred" accelerators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_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 four classes of accelerators in Ash:
James Cook 2014/09/19 16:13:15 Can you update this comment?
oshima 2014/09/19 18:55:19 Done.
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, Alt-Tab window cycling. 19 // * For example, Alt-Tab window cycling.
20 // * See kReservedActions below. 20 // * See kReservedActions below.
21 // 21 //
22 // Chrome OS system keys: 22 // Chrome OS system keys:
23 // * For legacy reasons, v1 apps can process and cancel. Otherwise handled 23 // * For legacy reasons, v1 apps can process and cancel. Otherwise handled
24 // directly by Ash. 24 // directly by Ash.
25 // * Brightness, volume control, etc. 25 // * Brightness, volume control, etc.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 WINDOW_SNAP_RIGHT, 129 WINDOW_SNAP_RIGHT,
130 #if defined(OS_CHROMEOS) 130 #if defined(OS_CHROMEOS)
131 ADD_REMOVE_DISPLAY, 131 ADD_REMOVE_DISPLAY,
132 TOGGLE_MIRROR_MODE, 132 TOGGLE_MIRROR_MODE,
133 DISABLE_GPU_WATCHDOG, 133 DISABLE_GPU_WATCHDOG,
134 LOCK_SCREEN, 134 LOCK_SCREEN,
135 OPEN_CROSH, 135 OPEN_CROSH,
136 OPEN_FILE_MANAGER, 136 OPEN_FILE_MANAGER,
137 SWITCH_TO_NEXT_USER, 137 SWITCH_TO_NEXT_USER,
138 SWITCH_TO_PREVIOUS_USER, 138 SWITCH_TO_PREVIOUS_USER,
139 #else
140 DUMMY_FOR_RESERVED,
139 #endif 141 #endif
140 }; 142 };
141 143
142 struct AcceleratorData { 144 struct AcceleratorData {
143 bool trigger_on_press; 145 bool trigger_on_press;
144 ui::KeyboardCode keycode; 146 ui::KeyboardCode keycode;
145 int modifiers; 147 int modifiers;
146 AcceleratorAction action; 148 AcceleratorAction action;
147 }; 149 };
148 150
149 // Accelerators handled by AcceleratorController. 151 // Accelerators handled by AcceleratorController.
150 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; 152 ASH_EXPORT extern const AcceleratorData kAcceleratorData[];
151 ASH_EXPORT extern const size_t kAcceleratorDataLength; 153 ASH_EXPORT extern const size_t kAcceleratorDataLength;
152 154
153 #if !defined(NDEBUG) 155 #if !defined(NDEBUG)
154 // Accelerators useful when running on desktop. Debug build only. 156 // Accelerators useful when running on desktop. Debug build only.
155 ASH_EXPORT extern const AcceleratorData kDesktopAcceleratorData[]; 157 ASH_EXPORT extern const AcceleratorData kDesktopAcceleratorData[];
156 ASH_EXPORT extern const size_t kDesktopAcceleratorDataLength; 158 ASH_EXPORT extern const size_t kDesktopAcceleratorDataLength;
157 #endif 159 #endif
158 160
159 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag 161 // Debug accelerators enabled only when "Debugging keyboard shortcuts" flag
160 // (--ash-debug-shortcuts) is enabled. 162 // (--ash-debug-shortcuts) is enabled.
161 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; 163 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[];
162 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; 164 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength;
163 165
164 // Actions that should be handled very early in Ash unless the current target 166 // Actions that should be handled very early in Ash unless the current target
165 // window is full-screen. 167 // window is full-screen.
168 ASH_EXPORT extern const AcceleratorAction kPreferredActions[];
169 ASH_EXPORT extern const size_t kPreferredActionsLength;
170
171 // Actions that are always handled in Ash
James Cook 2014/09/19 16:13:15 nit: end with .
oshima 2014/09/19 18:55:19 Done.
166 ASH_EXPORT extern const AcceleratorAction kReservedActions[]; 172 ASH_EXPORT extern const AcceleratorAction kReservedActions[];
167 ASH_EXPORT extern const size_t kReservedActionsLength; 173 ASH_EXPORT extern const size_t kReservedActionsLength;
168 174
169 // Actions that should be handled very early in Ash unless the current target 175 // Actions that should be handled very early in Ash unless the current target
170 // window is full-screen, these actions are only handled if 176 // window is full-screen, these actions are only handled if
171 // DebugShortcutsEnabled is true (command line switch 'ash-debug-shortcuts'). 177 // DebugShortcutsEnabled is true (command line switch 'ash-debug-shortcuts').
172 ASH_EXPORT extern const AcceleratorAction kReservedDebugActions[]; 178 ASH_EXPORT extern const AcceleratorAction kReservedDebugActions[];
173 ASH_EXPORT extern const size_t kReservedDebugActionsLength; 179 ASH_EXPORT extern const size_t kReservedDebugActionsLength;
174 180
175 // Actions allowed while user is not signed in or screen is locked. 181 // Actions allowed while user is not signed in or screen is locked.
(...skipping 17 matching lines...) Expand all
193 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[]; 199 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[];
194 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength; 200 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength;
195 201
196 // Actions that require at least 1 window. 202 // Actions that require at least 1 window.
197 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[]; 203 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[];
198 ASH_EXPORT extern const size_t kActionsNeedingWindowLength; 204 ASH_EXPORT extern const size_t kActionsNeedingWindowLength;
199 205
200 } // namespace ash 206 } // namespace ash
201 207
202 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ 208 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698