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

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: fix chromeos 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 96 // Explicitly call CommitPendingWrite so that this change gets written
97 // so that this change gets written immediately, in case the user shuts 97 // immediately, in case the user shuts down right now.
98 // down right now. TODO(dmazzoni) switch this back to 98 // TODO(dmazzoni) remove once http://crosbug.com/19491 is fixed.
Mattias Nissler (ping if slow) 2011/10/12 09:23:39 That bug is closed. Remove? Probably better not to
Bernhard Bauer 2011/10/12 11:02:05 OK. Dominic, can you take a look? :-D
99 // ScheduleSavePersistentPrefs once http://crosbug.com/19491 is fixed. 99 g_browser_process->local_state()->CommitPendingWrite();
100 g_browser_process->local_state()->SavePersistentPrefs();
101 ExtensionAccessibilityEventRouter::GetInstance()-> 100 ExtensionAccessibilityEventRouter::GetInstance()->
102 SetAccessibilityEnabled(enabled); 101 SetAccessibilityEnabled(enabled);
103 102
104 Speak(enabled ? 103 Speak(enabled ?
105 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : 104 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() :
106 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(), 105 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str(),
107 false, true); 106 false, true);
108 107
109 // Load/Unload ChromeVox 108 // Load/Unload ChromeVox
110 Profile* profile = ProfileManager::GetDefaultProfile(); 109 Profile* profile = ProfileManager::GetDefaultProfile();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 SetSpeakProperties(props.c_str()); 165 SetSpeakProperties(props.c_str());
167 } 166 }
168 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()-> 167 chromeos::CrosLibrary::Get()->GetSpeechSynthesisLibrary()->
169 Speak(speak_str); 168 Speak(speak_str);
170 } 169 }
171 } 170 }
172 171
173 172
174 } // namespace accessibility 173 } // namespace accessibility
175 } // namespace chromeos 174 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698