OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 5 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
6 | 6 |
7 #include "ash/audio/sounds.h" | 7 #include "ash/audio/sounds.h" |
8 #include "ash/autoclick/autoclick_controller.h" | 8 #include "ash/autoclick/autoclick_controller.h" |
9 #include "ash/high_contrast/high_contrast_controller.h" | 9 #include "ash/high_contrast/high_contrast_controller.h" |
10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 JoinString(preload_engines, ',')); | 854 JoinString(preload_engines, ',')); |
855 braille_ime_current_ = false; | 855 braille_ime_current_ = false; |
856 } | 856 } |
857 | 857 |
858 // Overridden from InputMethodManager::Observer. | 858 // Overridden from InputMethodManager::Observer. |
859 void AccessibilityManager::InputMethodChanged( | 859 void AccessibilityManager::InputMethodChanged( |
860 input_method::InputMethodManager* manager, | 860 input_method::InputMethodManager* manager, |
861 bool show_message) { | 861 bool show_message) { |
862 #if defined(USE_ASH) | 862 #if defined(USE_ASH) |
863 // Sticky keys is implemented only in ash. | 863 // Sticky keys is implemented only in ash. |
864 ash::Shell::GetInstance()->sticky_keys_controller()->SetModifiersEnabled( | 864 if (ash::Shell::HasInstance()) { |
865 manager->IsISOLevel5ShiftUsedByCurrentInputMethod(), | 865 ash::Shell::GetInstance()->sticky_keys_controller()->SetModifiersEnabled( |
866 manager->IsAltGrUsedByCurrentInputMethod()); | 866 manager->IsISOLevel5ShiftUsedByCurrentInputMethod(), |
| 867 manager->IsAltGrUsedByCurrentInputMethod()); |
| 868 } |
867 #endif | 869 #endif |
868 const chromeos::input_method::InputMethodDescriptor descriptor = | 870 const chromeos::input_method::InputMethodDescriptor descriptor = |
869 manager->GetActiveIMEState()->GetCurrentInputMethod(); | 871 manager->GetActiveIMEState()->GetCurrentInputMethod(); |
870 braille_ime_current_ = | 872 braille_ime_current_ = |
871 (descriptor.id() == extension_misc::kBrailleImeEngineId); | 873 (descriptor.id() == extension_misc::kBrailleImeEngineId); |
872 } | 874 } |
873 | 875 |
874 void AccessibilityManager::SetProfile(Profile* profile) { | 876 void AccessibilityManager::SetProfile(Profile* profile) { |
875 pref_change_registrar_.reset(); | 877 pref_change_registrar_.reset(); |
876 local_state_pref_change_registrar_.reset(); | 878 local_state_pref_change_registrar_.reset(); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 chrome_vox_loaded_on_lock_screen_; | 1118 chrome_vox_loaded_on_lock_screen_; |
1117 } | 1119 } |
1118 | 1120 |
1119 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { | 1121 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { |
1120 // Do any teardown work needed immediately after ChromeVox actually unloads. | 1122 // Do any teardown work needed immediately after ChromeVox actually unloads. |
1121 if (system_sounds_enabled_) | 1123 if (system_sounds_enabled_) |
1122 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); | 1124 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); |
1123 } | 1125 } |
1124 | 1126 |
1125 } // namespace chromeos | 1127 } // namespace chromeos |
OLD | NEW |