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

Unified Diff: ash/accelerators/accelerator_table.h

Issue 1177773002: Deprecating high-conflict accelerators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oshima's comments Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/accelerators/accelerator_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_table.h
diff --git a/ash/accelerators/accelerator_table.h b/ash/accelerators/accelerator_table.h
index 089e24050ffee760166ee32774a240f4e6cd50f8..ff5251c5fafe67c1ab1ab4ce058a0c68848f443e 100644
--- a/ash/accelerators/accelerator_table.h
+++ b/ash/accelerators/accelerator_table.h
@@ -152,10 +152,43 @@ struct AcceleratorData {
AcceleratorAction action;
};
+// Gathers the needed data to handle deprecated accelerators.
+struct DeprecatedAcceleratorData {
+ // The old deprecated accelerator.
+ AcceleratorData deprecated_accelerator;
+
+ // The name of the UMA histogram that will be used to measure the deprecated
+ // v.s. new accelerator usage.
+ const char* uma_histogram_name;
+
+ // The ID of the localized notification message to show to users informing
+ // them about the deprecation.
+ int notification_message_id;
+
+ // Specifies whether the deprecated accelerator is still enabled to do its
+ // associated action.
+ bool deprecated_enabled;
+};
+
+// This will be used for the UMA stats to measure the how many users are using
+// the old v.s. new accelerators.
+enum DeprecatedAcceleratorUsage {
+ DEPRECATED_USED = 0, // The deprecated accelerator is used.
+ NEW_USED, // The new accelerator is used.
+ DEPRECATED_USAGE_COUNT, // Maximum value of this enum for histogram use.
+};
+
// Accelerators handled by AcceleratorController.
ASH_EXPORT extern const AcceleratorData kAcceleratorData[];
ASH_EXPORT extern const size_t kAcceleratorDataLength;
+#if defined(OS_CHROMEOS)
+// The list of the deprecated accelerators along with their new replacing ones
+// and how to handle them.
+ASH_EXPORT extern const DeprecatedAcceleratorData kDeprecatedAccelerators[];
+ASH_EXPORT extern const size_t kDeprecatedAcceleratorsLength;
+#endif // defined(OS_CHROMEOS)
+
// Debug accelerators. Debug accelerators are only enabled when the "Debugging
// keyboard shortcuts" flag (--ash-debug-shortcuts) is enabled. Debug actions
// are always run (similar to reserved actions).
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/accelerators/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698