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

Side by Side Diff: chrome/browser/chromeos/accessibility/accessibility_manager.cc

Issue 312023002: Sync starting language and input method preferences (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 void AccessibilityManager::ReceiveBrailleDisplayState( 781 void AccessibilityManager::ReceiveBrailleDisplayState(
782 scoped_ptr<extensions::api::braille_display_private::DisplayState> state) { 782 scoped_ptr<extensions::api::braille_display_private::DisplayState> state) {
783 OnBrailleDisplayStateChanged(*state); 783 OnBrailleDisplayStateChanged(*state);
784 } 784 }
785 785
786 void AccessibilityManager::UpdateBrailleImeState() { 786 void AccessibilityManager::UpdateBrailleImeState() {
787 if (!profile_) 787 if (!profile_)
788 return; 788 return;
789 PrefService* pref_service = profile_->GetPrefs(); 789 PrefService* pref_service = profile_->GetPrefs();
790 std::vector<std::string> preload_engines; 790 std::vector<std::string> preload_engines;
791 base::SplitString(pref_service->GetString(prefs::kLanguagePreloadEngines), 791 base::SplitString(
792 ',', 792 pref_service->GetString(prefs::kLanguagePreloadEnginesLocal),
793 &preload_engines); 793 ',',
794 &preload_engines);
794 std::vector<std::string>::iterator it = 795 std::vector<std::string>::iterator it =
795 std::find(preload_engines.begin(), 796 std::find(preload_engines.begin(),
796 preload_engines.end(), 797 preload_engines.end(),
797 extension_misc::kBrailleImeEngineId); 798 extension_misc::kBrailleImeEngineId);
798 bool is_enabled = (it != preload_engines.end()); 799 bool is_enabled = (it != preload_engines.end());
799 bool should_be_enabled = 800 bool should_be_enabled =
800 (spoken_feedback_enabled_ && braille_display_connected_); 801 (spoken_feedback_enabled_ && braille_display_connected_);
801 if (is_enabled == should_be_enabled) 802 if (is_enabled == should_be_enabled)
802 return; 803 return;
803 if (should_be_enabled) 804 if (should_be_enabled)
804 preload_engines.push_back(extension_misc::kBrailleImeEngineId); 805 preload_engines.push_back(extension_misc::kBrailleImeEngineId);
805 else 806 else
806 preload_engines.erase(it); 807 preload_engines.erase(it);
807 pref_service->SetString(prefs::kLanguagePreloadEngines, 808 pref_service->SetString(prefs::kLanguagePreloadEnginesLocal,
808 JoinString(preload_engines, ',')); 809 JoinString(preload_engines, ','));
809 braille_ime_current_ = false; 810 braille_ime_current_ = false;
810 } 811 }
811 812
812 // Overridden from InputMethodManager::Observer. 813 // Overridden from InputMethodManager::Observer.
813 void AccessibilityManager::InputMethodChanged( 814 void AccessibilityManager::InputMethodChanged(
814 input_method::InputMethodManager* manager, 815 input_method::InputMethodManager* manager,
815 bool show_message) { 816 bool show_message) {
816 #if defined(USE_ASH) 817 #if defined(USE_ASH)
817 // Sticky keys is implemented only in ash. 818 // Sticky keys is implemented only in ash.
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 chrome_vox_loaded_on_lock_screen_; 1070 chrome_vox_loaded_on_lock_screen_;
1070 } 1071 }
1071 1072
1072 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) { 1073 void AccessibilityManager::PostUnloadChromeVox(Profile* profile) {
1073 // Do any teardown work needed immediately after ChromeVox actually unloads. 1074 // Do any teardown work needed immediately after ChromeVox actually unloads.
1074 if (system_sounds_enabled_) 1075 if (system_sounds_enabled_)
1075 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED); 1076 ash::PlaySystemSoundAlways(SOUND_SPOKEN_FEEDBACK_DISABLED);
1076 } 1077 }
1077 1078
1078 } // namespace chromeos 1079 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_utils.cc » ('j') | chrome/browser/chromeos/preferences.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698