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

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

Issue 8198007: Remove PrefService::ScheduleSavePersistentPrefs and SavePersistentPrefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 12 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/chromeos/audio_mixer_alsa.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/accessibility_util.h" 5 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/accessibility/accessibility_extension_api.h" 10 #include "chrome/browser/accessibility/accessibility_extension_api.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 g_browser_process->local_state()->GetBoolean( 88 g_browser_process->local_state()->GetBoolean(
89 prefs::kSpokenFeedbackEnabled); 89 prefs::kSpokenFeedbackEnabled);
90 if (accessibility_enabled == enabled) { 90 if (accessibility_enabled == enabled) {
91 LOG(INFO) << "Accessibility is already " << 91 LOG(INFO) << "Accessibility is already " <<
92 (enabled ? "enabled" : "disabled") << ". Going to do nothing."; 92 (enabled ? "enabled" : "disabled") << ". Going to do nothing.";
93 return; 93 return;
94 } 94 }
95 95
96 g_browser_process->local_state()->SetBoolean( 96 g_browser_process->local_state()->SetBoolean(
97 prefs::kSpokenFeedbackEnabled, enabled); 97 prefs::kSpokenFeedbackEnabled, enabled);
98 g_browser_process->local_state()->ScheduleSavePersistentPrefs(); 98 g_browser_process->local_state()->CommitPendingWrite();
99 ExtensionAccessibilityEventRouter::GetInstance()-> 99 ExtensionAccessibilityEventRouter::GetInstance()->
100 SetAccessibilityEnabled(enabled); 100 SetAccessibilityEnabled(enabled);
101 BrowserAccessibilityState::GetInstance()->OnAccessibilityEnabledManually(); 101 BrowserAccessibilityState::GetInstance()->OnAccessibilityEnabledManually();
102 102
103 Speak(enabled ? 103 Speak(enabled ?
104 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() : 104 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_ENABLED).c_str() :
105 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str()); 105 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_ACCESS_DISABLED).c_str());
106 106
107 // Load/Unload ChromeVox 107 // Load/Unload ChromeVox
108 Profile* profile = ProfileManager::GetDefaultProfile(); 108 Profile* profile = ProfileManager::GetDefaultProfile();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 return false; 175 return false;
176 } 176 }
177 PrefService* prefs = g_browser_process->local_state(); 177 PrefService* prefs = g_browser_process->local_state();
178 bool accessibility_enabled = prefs && 178 bool accessibility_enabled = prefs &&
179 prefs->GetBoolean(prefs::kSpokenFeedbackEnabled); 179 prefs->GetBoolean(prefs::kSpokenFeedbackEnabled);
180 return accessibility_enabled; 180 return accessibility_enabled;
181 } 181 }
182 182
183 } // namespace accessibility 183 } // namespace accessibility
184 } // namespace chromeos 184 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/chromeos/audio_mixer_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698