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

Unified Diff: chromeos/audio/audio_devices_pref_handler_stub.cc

Issue 1746843002: Persist the user's active audio device choice across chromeos session and reboots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 21c2fe1d4a268a922de4875c563954e489647131..82a5b4a5d3278e5d12600552743fdb226887e92e 100644
--- a/chromeos/audio/audio_devices_pref_handler_stub.cc
+++ b/chromeos/audio/audio_devices_pref_handler_stub.cc
@@ -47,17 +47,26 @@ void AudioDevicesPrefHandlerStub::SetMuteValue(const AudioDevice& device,
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::SetDeviceActive(const AudioDevice& device,
+ bool active,
+ bool activate_by_user) {
+ DeviceState state;
+ state.active = active;
+ state.activate_by_user = activate_by_user;
+ audio_device_state_map_[device.stable_device_id] = state;
}
-void AudioDevicesPrefHandlerStub::SetDeviceState(const AudioDevice& device,
- AudioDeviceState state) {
- audio_device_state_map_[device.stable_device_id] = state;
+bool AudioDevicesPrefHandlerStub::GetDeviceActive(const AudioDevice& device,
+ bool* active,
+ bool* activate_by_user) {
+ if (audio_device_state_map_.find(device.stable_device_id) ==
+ audio_device_state_map_.end()) {
+ return false;
+ }
+ *active = audio_device_state_map_[device.stable_device_id].active;
+ *activate_by_user =
+ audio_device_state_map_[device.stable_device_id].activate_by_user;
+ return true;
}
bool AudioDevicesPrefHandlerStub::GetAudioOutputAllowedValue() {

Powered by Google App Engine
This is Rietveld 408576698