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

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

Issue 1414483011: Deprecate Shift+Alt to switch IME and use Ctrl+Shift+Space instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ensure no line breaks in the middle of shortcuts texts Created 5 years, 1 month 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"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 struct AcceleratorData { 148 struct AcceleratorData {
149 bool trigger_on_press; 149 bool trigger_on_press;
150 ui::KeyboardCode keycode; 150 ui::KeyboardCode keycode;
151 int modifiers; 151 int modifiers;
152 AcceleratorAction action; 152 AcceleratorAction action;
153 }; 153 };
154 154
155 // Gathers the needed data to handle deprecated accelerators. 155 // Gathers the needed data to handle deprecated accelerators.
156 struct DeprecatedAcceleratorData { 156 struct DeprecatedAcceleratorData {
157 // The old deprecated accelerator. 157 // The action that has deprecated accelerators.
158 AcceleratorData deprecated_accelerator; 158 AcceleratorAction action;
159 159
160 // The name of the UMA histogram that will be used to measure the deprecated 160 // The name of the UMA histogram that will be used to measure the deprecated
161 // v.s. new accelerator usage. 161 // v.s. new accelerator usage.
162 const char* uma_histogram_name; 162 const char* uma_histogram_name;
163 163
164 // The ID of the localized notification message to show to users informing 164 // The ID of the localized notification message to show to users informing
165 // them about the deprecation. 165 // them about the deprecation.
166 int notification_message_id; 166 int notification_message_id;
167 167
168 // The ID of the localized old deprecated shortcut key.
169 int old_shortcut_id;
170
171 // The ID of the localized new shortcut key.
172 int new_shortcut_id;
173
168 // Specifies whether the deprecated accelerator is still enabled to do its 174 // Specifies whether the deprecated accelerator is still enabled to do its
169 // associated action. 175 // associated action.
170 bool deprecated_enabled; 176 bool deprecated_enabled;
171 }; 177 };
172 178
173 // This will be used for the UMA stats to measure the how many users are using 179 // This will be used for the UMA stats to measure the how many users are using
174 // the old v.s. new accelerators. 180 // the old v.s. new accelerators.
175 enum DeprecatedAcceleratorUsage { 181 enum DeprecatedAcceleratorUsage {
176 DEPRECATED_USED = 0, // The deprecated accelerator is used. 182 DEPRECATED_USED = 0, // The deprecated accelerator is used.
177 NEW_USED, // The new accelerator is used. 183 NEW_USED, // The new accelerator is used.
178 DEPRECATED_USAGE_COUNT, // Maximum value of this enum for histogram use. 184 DEPRECATED_USAGE_COUNT, // Maximum value of this enum for histogram use.
179 }; 185 };
180 186
181 // Accelerators handled by AcceleratorController. 187 // Accelerators handled by AcceleratorController.
182 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; 188 ASH_EXPORT extern const AcceleratorData kAcceleratorData[];
183 ASH_EXPORT extern const size_t kAcceleratorDataLength; 189 ASH_EXPORT extern const size_t kAcceleratorDataLength;
184 190
185 #if defined(OS_CHROMEOS) 191 #if defined(OS_CHROMEOS)
186 // The list of the deprecated accelerators along with their new replacing ones 192 // The list of the deprecated accelerators.
187 // and how to handle them. 193 ASH_EXPORT extern const AcceleratorData kDeprecatedAccelerators[];
188 ASH_EXPORT extern const DeprecatedAcceleratorData kDeprecatedAccelerators[];
189 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsLength; 194 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsLength;
195
196 // The list of the actions with deprecated accelerators and the needed data to
197 // handle them.
198 ASH_EXPORT extern const DeprecatedAcceleratorData kDeprecatedAcceleratorsData[];
199 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsDataLength;
190 #endif // defined(OS_CHROMEOS) 200 #endif // defined(OS_CHROMEOS)
191 201
192 // Debug accelerators. Debug accelerators are only enabled when the "Debugging 202 // Debug accelerators. Debug accelerators are only enabled when the "Debugging
193 // keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions 203 // keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions
194 // are always run (similar to reserved actions). 204 // are always run (similar to reserved actions).
195 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; 205 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[];
196 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; 206 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength;
197 207
198 // Actions that should be handled very early in Ash unless the current target 208 // Actions that should be handled very early in Ash unless the current target
199 // window is full-screen. 209 // window is full-screen.
(...skipping 29 matching lines...) Expand all
229 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[]; 239 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[];
230 ASH_EXPORT extern const size_t kActionsNeedingWindowLength; 240 ASH_EXPORT extern const size_t kActionsNeedingWindowLength;
231 241
232 // Actions that can be performed while keeping the menu open. 242 // Actions that can be performed while keeping the menu open.
233 ASH_EXPORT extern const AcceleratorAction kActionsKeepingMenuOpen[]; 243 ASH_EXPORT extern const AcceleratorAction kActionsKeepingMenuOpen[];
234 ASH_EXPORT extern const size_t kActionsKeepingMenuOpenLength; 244 ASH_EXPORT extern const size_t kActionsKeepingMenuOpenLength;
235 245
236 } // namespace ash 246 } // namespace ash
237 247
238 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ 248 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698