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

Side by Side Diff: chromeos/audio/audio_devices_pref_handler_impl.cc

Issue 2413963002: Replace FOR_EACH_OBSERVER in chromeos/ with range-based for (Closed)
Patch Set: Run the script again with '/mg' Created 4 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
« no previous file with comments | « no previous file | chromeos/audio/cras_audio_handler.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) 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 "chromeos/audio/audio_devices_pref_handler_impl.h" 5 #include "chromeos/audio/audio_devices_pref_handler_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 void AudioDevicesPrefHandlerImpl::MigrateDeviceVolumeSettings( 239 void AudioDevicesPrefHandlerImpl::MigrateDeviceVolumeSettings(
240 const std::string& active_device) { 240 const std::string& active_device) {
241 double old_volume = local_state_->GetDouble(prefs::kAudioVolumePercent); 241 double old_volume = local_state_->GetDouble(prefs::kAudioVolumePercent);
242 device_volume_settings_->SetDouble(active_device, old_volume); 242 device_volume_settings_->SetDouble(active_device, old_volume);
243 SaveDevicesVolumePref(); 243 SaveDevicesVolumePref();
244 } 244 }
245 245
246 void AudioDevicesPrefHandlerImpl::NotifyAudioPolicyChange() { 246 void AudioDevicesPrefHandlerImpl::NotifyAudioPolicyChange() {
247 FOR_EACH_OBSERVER(AudioPrefObserver, 247 for (auto& observer : observers_)
248 observers_, 248 observer.OnAudioPolicyPrefChanged();
249 OnAudioPolicyPrefChanged());
250 } 249 }
251 250
252 // static 251 // static
253 void AudioDevicesPrefHandlerImpl::RegisterPrefs(PrefRegistrySimple* registry) { 252 void AudioDevicesPrefHandlerImpl::RegisterPrefs(PrefRegistrySimple* registry) {
254 registry->RegisterDictionaryPref(prefs::kAudioDevicesVolumePercent); 253 registry->RegisterDictionaryPref(prefs::kAudioDevicesVolumePercent);
255 registry->RegisterDictionaryPref(prefs::kAudioDevicesMute); 254 registry->RegisterDictionaryPref(prefs::kAudioDevicesMute);
256 registry->RegisterDictionaryPref(prefs::kAudioDevicesState); 255 registry->RegisterDictionaryPref(prefs::kAudioDevicesState);
257 256
258 // Register the prefs backing the audio muting policies. 257 // Register the prefs backing the audio muting policies.
259 // Policy for audio input is handled by kAudioCaptureAllowed in the Chrome 258 // Policy for audio input is handled by kAudioCaptureAllowed in the Chrome
260 // media system. 259 // media system.
261 registry->RegisterBooleanPref(prefs::kAudioOutputAllowed, true); 260 registry->RegisterBooleanPref(prefs::kAudioOutputAllowed, true);
262 261
263 // Register the legacy audio prefs for migration. 262 // Register the legacy audio prefs for migration.
264 registry->RegisterDoublePref(prefs::kAudioVolumePercent, 263 registry->RegisterDoublePref(prefs::kAudioVolumePercent,
265 kDefaultOutputVolumePercent); 264 kDefaultOutputVolumePercent);
266 registry->RegisterIntegerPref(prefs::kAudioMute, kPrefMuteOff); 265 registry->RegisterIntegerPref(prefs::kAudioMute, kPrefMuteOff);
267 } 266 }
268 267
269 } // namespace chromeos 268 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698