| OLD | NEW |
| 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_stub.h" | 5 #include "chromeos/audio/audio_devices_pref_handler_stub.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chromeos/audio/audio_device.h" | 8 #include "chromeos/audio/audio_device.h" |
| 9 | 9 |
| 10 namespace chromeos { | 10 namespace chromeos { |
| 11 | 11 |
| 12 AudioDevicesPrefHandlerStub::AudioDevicesPrefHandlerStub() { | 12 AudioDevicesPrefHandlerStub::AudioDevicesPrefHandlerStub() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 AudioDevicesPrefHandlerStub::~AudioDevicesPrefHandlerStub() { | 15 AudioDevicesPrefHandlerStub::~AudioDevicesPrefHandlerStub() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 double AudioDevicesPrefHandlerStub::GetOutputVolumeValue( | 18 double AudioDevicesPrefHandlerStub::GetOutputVolumeValue( |
| 19 const AudioDevice* device) { | 19 const AudioDevice* device) { |
| 20 if (!device || | 20 if (!device || |
| 21 !ContainsKey(audio_device_volume_gain_map_, device->stable_device_id)) | 21 !base::ContainsKey(audio_device_volume_gain_map_, |
| 22 device->stable_device_id)) { |
| 22 return kDefaultOutputVolumePercent; | 23 return kDefaultOutputVolumePercent; |
| 24 } |
| 23 return audio_device_volume_gain_map_[device->stable_device_id]; | 25 return audio_device_volume_gain_map_[device->stable_device_id]; |
| 24 } | 26 } |
| 25 | 27 |
| 26 double AudioDevicesPrefHandlerStub::GetInputGainValue( | 28 double AudioDevicesPrefHandlerStub::GetInputGainValue( |
| 27 const AudioDevice* device) { | 29 const AudioDevice* device) { |
| 28 // TODO(rkc): The default value for gain is wrong. http://crbug.com/442489 | 30 // TODO(rkc): The default value for gain is wrong. http://crbug.com/442489 |
| 29 if (!device || | 31 if (!device || |
| 30 !ContainsKey(audio_device_volume_gain_map_, device->stable_device_id)) | 32 !base::ContainsKey(audio_device_volume_gain_map_, |
| 33 device->stable_device_id)) { |
| 31 return 75.0; | 34 return 75.0; |
| 35 } |
| 32 return audio_device_volume_gain_map_[device->stable_device_id]; | 36 return audio_device_volume_gain_map_[device->stable_device_id]; |
| 33 } | 37 } |
| 34 | 38 |
| 35 void AudioDevicesPrefHandlerStub::SetVolumeGainValue(const AudioDevice& device, | 39 void AudioDevicesPrefHandlerStub::SetVolumeGainValue(const AudioDevice& device, |
| 36 double value) { | 40 double value) { |
| 37 audio_device_volume_gain_map_[device.stable_device_id] = value; | 41 audio_device_volume_gain_map_[device.stable_device_id] = value; |
| 38 } | 42 } |
| 39 | 43 |
| 40 bool AudioDevicesPrefHandlerStub::GetMuteValue( | 44 bool AudioDevicesPrefHandlerStub::GetMuteValue( |
| 41 const AudioDevice& device) { | 45 const AudioDevice& device) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void AudioDevicesPrefHandlerStub::AddAudioPrefObserver( | 80 void AudioDevicesPrefHandlerStub::AddAudioPrefObserver( |
| 77 AudioPrefObserver* observer) { | 81 AudioPrefObserver* observer) { |
| 78 } | 82 } |
| 79 | 83 |
| 80 void AudioDevicesPrefHandlerStub::RemoveAudioPrefObserver( | 84 void AudioDevicesPrefHandlerStub::RemoveAudioPrefObserver( |
| 81 AudioPrefObserver* observer) { | 85 AudioPrefObserver* observer) { |
| 82 } | 86 } |
| 83 | 87 |
| 84 } // namespace chromeos | 88 } // namespace chromeos |
| 85 | 89 |
| OLD | NEW |