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

Side by Side Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2448663002: Revert of Add Ctrl+Alt+H as global shortcut to toggle high contrast mode. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | ash/common/accelerators/accelerator_table.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "ash/common/accelerators/accelerator_controller.h" 5 #include "ash/common/accelerators/accelerator_controller.h"
6 6
7 #include "ash/common/accelerators/accelerator_commands.h" 7 #include "ash/common/accelerators/accelerator_commands.h"
8 #include "ash/common/accelerators/accelerator_controller_delegate.h" 8 #include "ash/common/accelerators/accelerator_controller_delegate.h"
9 #include "ash/common/accelerators/debug_commands.h" 9 #include "ash/common/accelerators/debug_commands.h"
10 #include "ash/common/accessibility_delegate.h" 10 #include "ash/common/accessibility_delegate.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 459 }
460 460
461 void HandleToggleCapsLock() { 461 void HandleToggleCapsLock() {
462 base::RecordAction(UserMetricsAction("Accel_Toggle_Caps_Lock")); 462 base::RecordAction(UserMetricsAction("Accel_Toggle_Caps_Lock"));
463 chromeos::input_method::InputMethodManager* ime = 463 chromeos::input_method::InputMethodManager* ime =
464 chromeos::input_method::InputMethodManager::Get(); 464 chromeos::input_method::InputMethodManager::Get();
465 chromeos::input_method::ImeKeyboard* keyboard = ime->GetImeKeyboard(); 465 chromeos::input_method::ImeKeyboard* keyboard = ime->GetImeKeyboard();
466 keyboard->SetCapsLockEnabled(!keyboard->CapsLockIsEnabled()); 466 keyboard->SetCapsLockEnabled(!keyboard->CapsLockIsEnabled());
467 } 467 }
468 468
469 void HandleToggleHighContrast() {
470 base::RecordAction(UserMetricsAction("Accel_Toggle_High_Contrast"));
471
472 WmShell::Get()->accessibility_delegate()->ToggleHighContrast();
473 }
474
475 void HandleToggleSpokenFeedback() { 469 void HandleToggleSpokenFeedback() {
476 base::RecordAction(UserMetricsAction("Accel_Toggle_Spoken_Feedback")); 470 base::RecordAction(UserMetricsAction("Accel_Toggle_Spoken_Feedback"));
477 471
478 WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( 472 WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback(
479 A11Y_NOTIFICATION_SHOW); 473 A11Y_NOTIFICATION_SHOW);
480 } 474 }
481 475
482 void HandleVolumeDown(const ui::Accelerator& accelerator) { 476 void HandleVolumeDown(const ui::Accelerator& accelerator) {
483 VolumeControlDelegate* volume_delegate = 477 VolumeControlDelegate* volume_delegate =
484 WmShell::Get()->system_tray_delegate()->GetVolumeControlDelegate(); 478 WmShell::Get()->system_tray_delegate()->GetVolumeControlDelegate();
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 #if defined(OS_CHROMEOS) 819 #if defined(OS_CHROMEOS)
826 case BRIGHTNESS_DOWN: 820 case BRIGHTNESS_DOWN:
827 case BRIGHTNESS_UP: 821 case BRIGHTNESS_UP:
828 case KEYBOARD_BRIGHTNESS_DOWN: 822 case KEYBOARD_BRIGHTNESS_DOWN:
829 case KEYBOARD_BRIGHTNESS_UP: 823 case KEYBOARD_BRIGHTNESS_UP:
830 case OPEN_CROSH: 824 case OPEN_CROSH:
831 case OPEN_FILE_MANAGER: 825 case OPEN_FILE_MANAGER:
832 case OPEN_GET_HELP: 826 case OPEN_GET_HELP:
833 case SHOW_IME_MENU_BUBBLE: 827 case SHOW_IME_MENU_BUBBLE:
834 case SUSPEND: 828 case SUSPEND:
835 case TOGGLE_HIGH_CONTRAST:
836 case TOGGLE_SPOKEN_FEEDBACK: 829 case TOGGLE_SPOKEN_FEEDBACK:
837 case TOGGLE_WIFI: 830 case TOGGLE_WIFI:
838 case VOLUME_DOWN: 831 case VOLUME_DOWN:
839 case VOLUME_MUTE: 832 case VOLUME_MUTE:
840 case VOLUME_UP: 833 case VOLUME_UP:
841 #else 834 #else
842 case DUMMY_FOR_RESERVED: 835 case DUMMY_FOR_RESERVED:
843 #endif 836 #endif
844 return true; 837 return true;
845 838
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 break; 1036 break;
1044 case SWITCH_TO_NEXT_USER: 1037 case SWITCH_TO_NEXT_USER:
1045 HandleCycleUser(SessionStateDelegate::CYCLE_TO_NEXT_USER); 1038 HandleCycleUser(SessionStateDelegate::CYCLE_TO_NEXT_USER);
1046 break; 1039 break;
1047 case SWITCH_TO_PREVIOUS_USER: 1040 case SWITCH_TO_PREVIOUS_USER:
1048 HandleCycleUser(SessionStateDelegate::CYCLE_TO_PREVIOUS_USER); 1041 HandleCycleUser(SessionStateDelegate::CYCLE_TO_PREVIOUS_USER);
1049 break; 1042 break;
1050 case TOGGLE_CAPS_LOCK: 1043 case TOGGLE_CAPS_LOCK:
1051 HandleToggleCapsLock(); 1044 HandleToggleCapsLock();
1052 break; 1045 break;
1053 case TOGGLE_HIGH_CONTRAST:
1054 HandleToggleHighContrast();
1055 break;
1056 case TOGGLE_SPOKEN_FEEDBACK: 1046 case TOGGLE_SPOKEN_FEEDBACK:
1057 HandleToggleSpokenFeedback(); 1047 HandleToggleSpokenFeedback();
1058 break; 1048 break;
1059 case TOGGLE_WIFI: 1049 case TOGGLE_WIFI:
1060 WmShell::Get()->system_tray_notifier()->NotifyRequestToggleWifi(); 1050 WmShell::Get()->system_tray_notifier()->NotifyRequestToggleWifi();
1061 break; 1051 break;
1062 case VOLUME_DOWN: 1052 case VOLUME_DOWN:
1063 HandleVolumeDown(accelerator); 1053 HandleVolumeDown(accelerator);
1064 break; 1054 break;
1065 case VOLUME_MUTE: 1055 case VOLUME_MUTE:
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && 1113 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() &&
1124 actions_needing_window_.find(action) != actions_needing_window_.end()) { 1114 actions_needing_window_.find(action) != actions_needing_window_.end()) {
1125 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( 1115 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert(
1126 A11Y_ALERT_WINDOW_NEEDED); 1116 A11Y_ALERT_WINDOW_NEEDED);
1127 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; 1117 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
1128 } 1118 }
1129 return RESTRICTION_NONE; 1119 return RESTRICTION_NONE;
1130 } 1120 }
1131 1121
1132 } // namespace ash 1122 } // namespace ash
OLDNEW
« 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