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

Unified Diff: chromeos/audio/audio_devices_pref_handler_stub.cc

Issue 1380103003: Store audio device's active state in preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix string format Created 4 years, 11 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 | « chromeos/audio/audio_devices_pref_handler_stub.h ('k') | chromeos/audio/cras_audio_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/audio_devices_pref_handler_stub.cc
diff --git a/chromeos/audio/audio_devices_pref_handler_stub.cc b/chromeos/audio/audio_devices_pref_handler_stub.cc
index 6c59877400083d3e808416d11ab286e4b352b819..21c2fe1d4a268a922de4875c563954e489647131 100644
--- a/chromeos/audio/audio_devices_pref_handler_stub.cc
+++ b/chromeos/audio/audio_devices_pref_handler_stub.cc
@@ -17,32 +17,47 @@ AudioDevicesPrefHandlerStub::~AudioDevicesPrefHandlerStub() {
double AudioDevicesPrefHandlerStub::GetOutputVolumeValue(
const AudioDevice* device) {
- if (!device || !ContainsKey(audio_device_volume_gain_map_, device->id))
+ if (!device ||
+ !ContainsKey(audio_device_volume_gain_map_, device->stable_device_id))
return kDefaultOutputVolumePercent;
- return audio_device_volume_gain_map_[device->id];
+ return audio_device_volume_gain_map_[device->stable_device_id];
}
double AudioDevicesPrefHandlerStub::GetInputGainValue(
const AudioDevice* device) {
// TODO(rkc): The default value for gain is wrong. http://crbug.com/442489
- if (!device || !ContainsKey(audio_device_volume_gain_map_, device->id))
+ if (!device ||
+ !ContainsKey(audio_device_volume_gain_map_, device->stable_device_id))
return 75.0;
- return audio_device_volume_gain_map_[device->id];
+ return audio_device_volume_gain_map_[device->stable_device_id];
}
void AudioDevicesPrefHandlerStub::SetVolumeGainValue(const AudioDevice& device,
double value) {
- audio_device_volume_gain_map_[device.id] = value;
+ audio_device_volume_gain_map_[device.stable_device_id] = value;
}
bool AudioDevicesPrefHandlerStub::GetMuteValue(
const AudioDevice& device) {
- return audio_device_mute_map_[device.id];
+ return audio_device_mute_map_[device.stable_device_id];
}
void AudioDevicesPrefHandlerStub::SetMuteValue(const AudioDevice& device,
bool mute_on) {
- audio_device_mute_map_[device.id] = mute_on;
+ audio_device_mute_map_[device.stable_device_id] = mute_on;
+}
+
+AudioDeviceState AudioDevicesPrefHandlerStub::GetDeviceState(
+ const AudioDevice& device) {
+ if (audio_device_state_map_.find(device.stable_device_id) ==
+ audio_device_state_map_.end())
+ return AUDIO_STATE_NOT_AVAILABLE;
+ return audio_device_state_map_[device.stable_device_id];
+}
+
+void AudioDevicesPrefHandlerStub::SetDeviceState(const AudioDevice& device,
+ AudioDeviceState state) {
+ audio_device_state_map_[device.stable_device_id] = state;
}
bool AudioDevicesPrefHandlerStub::GetAudioOutputAllowedValue() {
« no previous file with comments | « chromeos/audio/audio_devices_pref_handler_stub.h ('k') | chromeos/audio/cras_audio_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698