| 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/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 #endif | 146 #endif |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 struct AcceleratorData { | 149 struct AcceleratorData { |
| 150 bool trigger_on_press; | 150 bool trigger_on_press; |
| 151 ui::KeyboardCode keycode; | 151 ui::KeyboardCode keycode; |
| 152 int modifiers; | 152 int modifiers; |
| 153 AcceleratorAction action; | 153 AcceleratorAction action; |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 // Gathers the needed data to handle deprecated accelerators. |
| 157 struct DeprecatedAcceleratorData { |
| 158 // The old deprecated accelerator. |
| 159 AcceleratorData deprecated_accelerator; |
| 160 |
| 161 // The new accelerator to replace the old one above. |
| 162 AcceleratorData new_accelerator; |
| 163 |
| 164 // The name of the UMA histogram that will be used to measure the deprecated |
| 165 // v.s. new accelerator usage. |
| 166 const char* uma_histogram_name; |
| 167 |
| 168 // The ID of the localized notification message to show to users informing |
| 169 // them about the deprecation. |
| 170 int notification_message_id; |
| 171 |
| 172 // Specifies whether the deprecation notification should still be shown to |
| 173 // users. |
| 174 bool should_show_notification; |
| 175 |
| 176 // Specifies whether the deprecated accelerator is still enabled to do its |
| 177 // associated action. |
| 178 bool deprecated_enabled; |
| 179 }; |
| 180 |
| 181 // This will be used for the UMA stats to measure the how many users are using |
| 182 // the old v.s. new accelerators. |
| 183 enum DeprecatedAcceleratorUsage { |
| 184 DEPRECATED_USED = 0, // The deprecated accelerator is used. |
| 185 NEW_USED, // The new accelerator is used. |
| 186 DEPRECATED_USAGE_COUNT, // Maximum value of this enum for histogram use. |
| 187 }; |
| 188 |
| 156 // Accelerators handled by AcceleratorController. | 189 // Accelerators handled by AcceleratorController. |
| 157 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; | 190 ASH_EXPORT extern const AcceleratorData kAcceleratorData[]; |
| 158 ASH_EXPORT extern const size_t kAcceleratorDataLength; | 191 ASH_EXPORT extern const size_t kAcceleratorDataLength; |
| 159 | 192 |
| 193 // The list of the deprecated accelerators along with their new replacing ones |
| 194 // and how to handle them. |
| 195 ASH_EXPORT extern const DeprecatedAcceleratorData kDeprecatedAccelerators[]; |
| 196 ASH_EXPORT extern const size_t kDeprecatedAcceleratorsLength; |
| 197 |
| 160 // Debug accelerators. Debug accelerators are only enabled when the "Debugging | 198 // Debug accelerators. Debug accelerators are only enabled when the "Debugging |
| 161 // keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions | 199 // keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions |
| 162 // are always run (similar to reserved actions). | 200 // are always run (similar to reserved actions). |
| 163 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; | 201 ASH_EXPORT extern const AcceleratorData kDebugAcceleratorData[]; |
| 164 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; | 202 ASH_EXPORT extern const size_t kDebugAcceleratorDataLength; |
| 165 | 203 |
| 166 // Actions that should be handled very early in Ash unless the current target | 204 // Actions that should be handled very early in Ash unless the current target |
| 167 // window is full-screen. | 205 // window is full-screen. |
| 168 ASH_EXPORT extern const AcceleratorAction kPreferredActions[]; | 206 ASH_EXPORT extern const AcceleratorAction kPreferredActions[]; |
| 169 ASH_EXPORT extern const size_t kPreferredActionsLength; | 207 ASH_EXPORT extern const size_t kPreferredActionsLength; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 193 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[]; | 231 ASH_EXPORT extern const AcceleratorAction kActionsAllowedInAppMode[]; |
| 194 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength; | 232 ASH_EXPORT extern const size_t kActionsAllowedInAppModeLength; |
| 195 | 233 |
| 196 // Actions that require at least 1 window. | 234 // Actions that require at least 1 window. |
| 197 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[]; | 235 ASH_EXPORT extern const AcceleratorAction kActionsNeedingWindow[]; |
| 198 ASH_EXPORT extern const size_t kActionsNeedingWindowLength; | 236 ASH_EXPORT extern const size_t kActionsNeedingWindowLength; |
| 199 | 237 |
| 200 } // namespace ash | 238 } // namespace ash |
| 201 | 239 |
| 202 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ | 240 #endif // ASH_ACCELERATORS_ACCELERATOR_TABLE_H_ |
| OLD | NEW |