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

Side by Side Diff: chrome/browser/chromeos/accessibility_util.cc

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_util.h" 5 #include "chrome/browser/chromeos/accessibility_util.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/cros/cros_library.h" 10 #include "chrome/browser/chromeos/cros/cros_library.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 g_browser_process->local_state()->GetBoolean( 86 g_browser_process->local_state()->GetBoolean(
87 prefs::kAccessibilityEnabled); 87 prefs::kAccessibilityEnabled);
88 if (accessibility_enabled == enabled) { 88 if (accessibility_enabled == enabled) {
89 LOG(INFO) << "Accessibility is already " << 89 LOG(INFO) << "Accessibility is already " <<
90 (enabled ? "enabled" : "disabled") << ". Going to do nothing."; 90 (enabled ? "enabled" : "disabled") << ". Going to do nothing.";
91 return; 91 return;
92 } 92 }
93 93
94 g_browser_process->local_state()->SetBoolean( 94 g_browser_process->local_state()->SetBoolean(
95 prefs::kAccessibilityEnabled, enabled); 95 prefs::kAccessibilityEnabled, enabled);
96 // Explicitly call SavePersistentPrefs instead of ScheduleSavePersistentPrefs
97 // so that this change gets written immediately, in case the user shuts
98 // down right now. TODO(dmazzoni) switch this back to
99 // ScheduleSavePersistentPrefs once http://crosbug.com/19491 is fixed.
100 g_browser_process->local_state()->SavePersistentPrefs();
101 ExtensionAccessibilityEventRouter::GetInstance()-> 96 ExtensionAccessibilityEventRouter::GetInstance()->
102 SetAccessibilityEnabled(enabled); 97 SetAccessibilityEnabled(enabled);
103 98
104 Speak(enabled ? 99 Speak(enabled ?
105 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : 100 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() :
106 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(), 101 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(),
107 false, true); 102 false, true);
108 103
109 // Load/Unload ChromeVox 104 // Load/Unload ChromeVox
110 Profile* profile = ProfileManager::GetDefaultProfile(); 105 Profile* profile = ProfileManager::GetDefaultProfile();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 SetSpeakProperties(props.c_str()); 161 SetSpeakProperties(props.c_str());
167 } 162 }
168 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()-> 163 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
169 Speak(speak_str); 164 Speak(speak_str);
170 } 165 }
171 } 166 }
172 167
173 168
174 } // namespace accessibility 169 } // namespace accessibility
175 } // namespace chromeos 170 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698