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

Unified Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2352213002: Add Ctrl+Alt+H as global shortcut to toggle high contrast mode. (Closed)
Patch Set: Update action description Created 4 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 | « no previous file | ash/common/accelerators/accelerator_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index 080315a496d03c481ef131ff4f91fb6f7348b9c6..aa8bcf0573b83f1d71afcfe1d39df6d2c34ccccb 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -466,6 +466,12 @@ void HandleToggleCapsLock() {
keyboard->SetCapsLockEnabled(!keyboard->CapsLockIsEnabled());
}
+void HandleToggleHighContrast() {
+ base::RecordAction(UserMetricsAction("Accel_Toggle_High_Contrast"));
+
+ WmShell::Get()->accessibility_delegate()->ToggleHighContrast();
+}
+
void HandleToggleSpokenFeedback() {
base::RecordAction(UserMetricsAction("Accel_Toggle_Spoken_Feedback"));
@@ -826,6 +832,7 @@ bool AcceleratorController::CanPerformAction(
case OPEN_GET_HELP:
case SHOW_IME_MENU_BUBBLE:
case SUSPEND:
+ case TOGGLE_HIGH_CONTRAST:
case TOGGLE_SPOKEN_FEEDBACK:
case TOGGLE_WIFI:
case VOLUME_DOWN:
@@ -1043,6 +1050,9 @@ void AcceleratorController::PerformAction(AcceleratorAction action,
case TOGGLE_CAPS_LOCK:
HandleToggleCapsLock();
break;
+ case TOGGLE_HIGH_CONTRAST:
+ HandleToggleHighContrast();
+ break;
case TOGGLE_SPOKEN_FEEDBACK:
HandleToggleSpokenFeedback();
break;
« no previous file with comments | « no previous file | ash/common/accelerators/accelerator_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698