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

Unified Diff: ash/accelerators/accelerator_table.cc

Issue 1177773002: Deprecating high-conflict accelerators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added deprecation for the Shift+Esc Created 5 years, 6 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
Index: ash/accelerators/accelerator_table.cc
diff --git a/ash/accelerators/accelerator_table.cc b/ash/accelerators/accelerator_table.cc
index 93ddb01fa9d3581d4af479107ab747eed41d2915..e0e5487ff9255fa453df65aea8661bad3d0544c4 100644
--- a/ash/accelerators/accelerator_table.cc
+++ b/ash/accelerators/accelerator_table.cc
@@ -5,6 +5,7 @@
#include "ash/accelerators/accelerator_table.h"
#include "base/basictypes.h"
+#include "chrome/grit/generated_resources.h"
namespace ash {
@@ -53,7 +54,6 @@ const AcceleratorData kAcceleratorData[] = {
MAGNIFY_SCREEN_ZOOM_OUT},
{ true, ui::VKEY_BRIGHTNESS_UP, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN,
MAGNIFY_SCREEN_ZOOM_IN},
- { true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, LOCK_SCREEN },
// The lock key on Chrome OS keyboards produces F13 scancodes.
{ true, ui::VKEY_F13, ui::EF_NONE, LOCK_PRESSED },
{ false, ui::VKEY_F13, ui::EF_NONE, LOCK_RELEASED },
@@ -140,7 +140,6 @@ const AcceleratorData kAcceleratorData[] = {
SHOW_MESSAGE_CENTER_BUBBLE },
{ true, ui::VKEY_S, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN,
SHOW_SYSTEM_TRAY_BUBBLE },
- { true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER },
{ true, ui::VKEY_1, ui::EF_ALT_DOWN, LAUNCH_APP_0 },
{ true, ui::VKEY_2, ui::EF_ALT_DOWN, LAUNCH_APP_1 },
{ true, ui::VKEY_3, ui::EF_ALT_DOWN, LAUNCH_APP_2 },
@@ -182,6 +181,45 @@ const AcceleratorData kAcceleratorData[] = {
const size_t kAcceleratorDataLength = arraysize(kAcceleratorData);
+// Instructions for how to deprecate and replace an Accelerator:
+//
+// 1- Remove the old deprecated accelerator from the above list.
+// 2- Add an entry for it in the following |kDeprecatedAccelerators| list.
+// 3- That entry should contain the following:
+// - The deprecated accelerator data you removed from above.
+// - The new accelerator that should replace it.
+// - Both the new and old accelerators MUST map to the same
+// |AcceleratorAction|.
+// - Define a histogram for this action in |histograms.xml| in the form
+// "Ash.Accelerators.{ActionName}" and include the name of this histogram
+// in this entry.
+// - The ID of the localized notification message to give the users telling
+// them about the deprecation (Add one in |generated_resources.grd|.
+// Search for the comment <!-- Deprecated Accelerators Messages -->).
+// - {true or false} whether the notification should be displayed every time
+// the user uses the deprecated accelerator.
+// - {true or false} whether the deprecated accelerator is still enabled (we
+// don't disable a deprecated accelerator abruptly).
+
+const DeprecatedAcceleratorData kDeprecatedAccelerators[] = {
+ {{true, ui::VKEY_ESCAPE, ui::EF_SHIFT_DOWN, SHOW_TASK_MANAGER},
+ {true, ui::VKEY_ESCAPE, ui::EF_COMMAND_DOWN, SHOW_TASK_MANAGER},
+ "Ash.Accelerators.ShowTaskManager",
+ IDS_DEPRECATED_SHOW_TASK_MANAGER_MSG,
+ true,
+ true},
+#if defined(OS_CHROMEOS)
+ {{true, ui::VKEY_L, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, LOCK_SCREEN},
+ {true, ui::VKEY_L, ui::EF_COMMAND_DOWN, LOCK_SCREEN},
+ "Ash.Accelerators.LockScreen",
+ IDS_DEPRECATED_LOCK_SCREEN_MSG,
+ true,
+ true},
+#endif // defined(OS_CHROMEOS)
+};
+
+const size_t kDeprecatedAcceleratorsLength = arraysize(kDeprecatedAccelerators);
+
const AcceleratorData kDebugAcceleratorData[] = {
#if defined(OS_CHROMEOS)
// Extra shortcut for debug build to control magnifier on linux desktop.

Powered by Google App Engine
This is Rietveld 408576698