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

Unified Diff: chrome/browser/chromeos/audio/audio_handler.cc

Issue 11741003: Remove PrefServiceSimple, replacing it with PrefService and PrefRegistrySimple. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix double registration in Chrome Frame test. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/audio/audio_handler.h ('k') | chrome/browser/chromeos/customization_document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/audio/audio_handler.cc
diff --git a/chrome/browser/chromeos/audio/audio_handler.cc b/chrome/browser/chromeos/audio/audio_handler.cc
index d5093192284afd179e236b9e170e132e56d09e4d..ebf4fcd3092483e6c7d43891f21355576862d784 100644
--- a/chrome/browser/chromeos/audio/audio_handler.cc
+++ b/chrome/browser/chromeos/audio/audio_handler.cc
@@ -17,6 +17,7 @@
#else
#include "chrome/browser/chromeos/audio/audio_mixer_alsa.h"
#endif
+#include "chrome/browser/prefs/pref_registry_simple.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
@@ -79,27 +80,15 @@ AudioHandler* AudioHandler::GetInstance() {
}
// static
-void AudioHandler::RegisterPrefs(PrefServiceSimple* local_state) {
- if (!local_state->FindPreference(prefs::kAudioVolumePercent)) {
- local_state->RegisterDoublePref(prefs::kAudioVolumePercent,
- kDefaultVolumePercent);
- }
- if (!local_state->FindPreference(prefs::kAudioMute)) {
- local_state->RegisterIntegerPref(prefs::kAudioMute,
- kPrefMuteOff);
- }
-
- if (!local_state->FindPreference(prefs::kAudioOutputAllowed)) {
- // Register the prefs backing the audio muting policies.
- local_state->RegisterBooleanPref(prefs::kAudioOutputAllowed,
- true);
- }
+void AudioHandler::RegisterPrefs(PrefRegistrySimple* registry) {
+ registry->RegisterDoublePref(prefs::kAudioVolumePercent,
+ kDefaultVolumePercent);
+ registry->RegisterIntegerPref(prefs::kAudioMute, kPrefMuteOff);
+ // Register the prefs backing the audio muting policies.
+ registry->RegisterBooleanPref(prefs::kAudioOutputAllowed, true);
// This pref has moved to the media subsystem but we should verify it is there
// before we use it.
- if (!local_state->FindPreference(prefs::kAudioCaptureAllowed)) {
- local_state->RegisterBooleanPref(prefs::kAudioCaptureAllowed,
- true);
- }
+ registry->RegisterBooleanPref(prefs::kAudioCaptureAllowed, true);
}
double AudioHandler::GetVolumePercent() {
« no previous file with comments | « chrome/browser/chromeos/audio/audio_handler.h ('k') | chrome/browser/chromeos/customization_document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698