| 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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 void AccessibilityManager::InputMethodChanged( | 851 void AccessibilityManager::InputMethodChanged( |
| 852 input_method::InputMethodManager* manager, | 852 input_method::InputMethodManager* manager, |
| 853 bool show_message) { | 853 bool show_message) { |
| 854 #if defined(USE_ASH) | 854 #if defined(USE_ASH) |
| 855 // Sticky keys is implemented only in ash. | 855 // Sticky keys is implemented only in ash. |
| 856 ash::Shell::GetInstance()->sticky_keys_controller()->SetModifiersEnabled( | 856 ash::Shell::GetInstance()->sticky_keys_controller()->SetModifiersEnabled( |
| 857 manager->IsISOLevel5ShiftUsedByCurrentInputMethod(), | 857 manager->IsISOLevel5ShiftUsedByCurrentInputMethod(), |
| 858 manager->IsAltGrUsedByCurrentInputMethod()); | 858 manager->IsAltGrUsedByCurrentInputMethod()); |
| 859 #endif | 859 #endif |
| 860 const chromeos::input_method::InputMethodDescriptor descriptor = | 860 const chromeos::input_method::InputMethodDescriptor descriptor = |
| 861 manager->GetCurrentInputMethod(); | 861 manager->GetActiveIMEState()->GetCurrentInputMethod(); |
| 862 braille_ime_current_ = | 862 braille_ime_current_ = |
| 863 (descriptor.id() == extension_misc::kBrailleImeEngineId); | 863 (descriptor.id() == extension_misc::kBrailleImeEngineId); |
| 864 } | 864 } |
| 865 | 865 |
| 866 void AccessibilityManager::SetProfile(Profile* profile) { | 866 void AccessibilityManager::SetProfile(Profile* profile) { |
| 867 pref_change_registrar_.reset(); | 867 pref_change_registrar_.reset(); |
| 868 local_state_pref_change_registrar_.reset(); | 868 local_state_pref_change_registrar_.reset(); |
| 869 | 869 |
| 870 if (profile) { | 870 if (profile) { |
| 871 // TODO(yoshiki): Move following code to PrefHandler. | 871 // TODO(yoshiki): Move following code to PrefHandler. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 braille_display_connected_, | 1079 braille_display_connected_, |
| 1080 ash::A11Y_NOTIFICATION_SHOW); | 1080 ash::A11Y_NOTIFICATION_SHOW); |
| 1081 NotifyAccessibilityStatusChanged(details); | 1081 NotifyAccessibilityStatusChanged(details); |
| 1082 } | 1082 } |
| 1083 | 1083 |
| 1084 void AccessibilityManager::OnBrailleKeyEvent(const KeyEvent& event) { | 1084 void AccessibilityManager::OnBrailleKeyEvent(const KeyEvent& event) { |
| 1085 // Ensure the braille IME is active on braille keyboard (dots) input. | 1085 // Ensure the braille IME is active on braille keyboard (dots) input. |
| 1086 if ((event.command == | 1086 if ((event.command == |
| 1087 extensions::api::braille_display_private::KEY_COMMAND_DOTS) && | 1087 extensions::api::braille_display_private::KEY_COMMAND_DOTS) && |
| 1088 !braille_ime_current_) { | 1088 !braille_ime_current_) { |
| 1089 input_method::InputMethodManager::Get()->ChangeInputMethod( | 1089 input_method::InputMethodManager::Get() |
| 1090 extension_misc::kBrailleImeEngineId); | 1090 ->GetActiveIMEState() |
| 1091 ->ChangeInputMethod(extension_misc::kBrailleImeEngineId, |
| 1092 false /* show_message */); |
| 1091 } | 1093 } |
| 1092 } | 1094 } |
| 1093 | 1095 |
| 1094 void AccessibilityManager::PostLoadChromeVox(Profile* profile) { | 1096 void AccessibilityManager::PostLoadChromeVox(Profile* profile) { |
| 1095 // Do any setup work needed immediately after ChromeVox actually loads. | 1097 // Do any setup work needed immediately after ChromeVox actually loads. |
| 1096 if (system_sounds_enabled_) | 1098 if (system_sounds_enabled_) |
| 1097 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_ENABLED); | 1099 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_ENABLED); |
| 1098 | 1100 |
| 1099 ExtensionAccessibilityEventRouter::GetInstance()-> | 1101 ExtensionAccessibilityEventRouter::GetInstance()-> |
| 1100 OnChromeVoxLoadStateChanged(profile_, | 1102 OnChromeVoxLoadStateChanged(profile_, |
| 1101 IsSpokenFeedbackEnabled(), | 1103 IsSpokenFeedbackEnabled(), |
| 1102 chrome_vox_loaded_on_lock_screen_ || | 1104 chrome_vox_loaded_on_lock_screen_ || |
| 1103 should_speak_chrome_vox_announcements_on_user_screen_); | 1105 should_speak_chrome_vox_announcements_on_user_screen_); |
| 1104 | 1106 |
| 1105 should_speak_chrome_vox_announcements_on_user_screen_ = | 1107 should_speak_chrome_vox_announcements_on_user_screen_ = |
| 1106 chrome_vox_loaded_on_lock_screen_; | 1108 chrome_vox_loaded_on_lock_screen_; |
| 1107 } | 1109 } |
| 1108 | 1110 |
| 1109 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { | 1111 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { |
| 1110 // Do any teardown work needed immediately after ChromeVox actually unloads. | 1112 // Do any teardown work needed immediately after ChromeVox actually unloads. |
| 1111 if (system_sounds_enabled_) | 1113 if (system_sounds_enabled_) |
| 1112 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); | 1114 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); |
| 1113 } | 1115 } |
| 1114 | 1116 |
| 1115 } // namespace chromeos | 1117 } // namespace chromeos |
| OLD | NEW |