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

Side by Side 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: Fix nits. Created 4 years, 9 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 | « chromeos/audio/audio_devices_pref_handler_stub.h ('k') | chromeos/audio/cras_audio_handler.h » ('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_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 {
(...skipping 29 matching lines...) Expand all
40 bool AudioDevicesPrefHandlerStub::GetMuteValue( 40 bool AudioDevicesPrefHandlerStub::GetMuteValue(
41 const AudioDevice& device) { 41 const AudioDevice& device) {
42 return audio_device_mute_map_[device.stable_device_id]; 42 return audio_device_mute_map_[device.stable_device_id];
43 } 43 }
44 44
45 void AudioDevicesPrefHandlerStub::SetMuteValue(const AudioDevice& device, 45 void AudioDevicesPrefHandlerStub::SetMuteValue(const AudioDevice& device,
46 bool mute_on) { 46 bool mute_on) {
47 audio_device_mute_map_[device.stable_device_id] = mute_on; 47 audio_device_mute_map_[device.stable_device_id] = mute_on;
48 } 48 }
49 49
50 AudioDeviceState AudioDevicesPrefHandlerStub::GetDeviceState( 50 void AudioDevicesPrefHandlerStub::SetDeviceActive(const AudioDevice& device,
51 const AudioDevice& device) { 51 bool active,
52 if (audio_device_state_map_.find(device.stable_device_id) == 52 bool activate_by_user) {
53 audio_device_state_map_.end()) 53 DeviceState state;
54 return AUDIO_STATE_NOT_AVAILABLE; 54 state.active = active;
55 return audio_device_state_map_[device.stable_device_id]; 55 state.activate_by_user = activate_by_user;
56 }
57
58 void AudioDevicesPrefHandlerStub::SetDeviceState(const AudioDevice& device,
59 AudioDeviceState state) {
60 audio_device_state_map_[device.stable_device_id] = state; 56 audio_device_state_map_[device.stable_device_id] = state;
61 } 57 }
62 58
59 bool AudioDevicesPrefHandlerStub::GetDeviceActive(const AudioDevice& device,
60 bool* active,
61 bool* activate_by_user) {
62 if (audio_device_state_map_.find(device.stable_device_id) ==
63 audio_device_state_map_.end()) {
64 return false;
65 }
66 *active = audio_device_state_map_[device.stable_device_id].active;
67 *activate_by_user =
68 audio_device_state_map_[device.stable_device_id].activate_by_user;
69 return true;
70 }
71
63 bool AudioDevicesPrefHandlerStub::GetAudioOutputAllowedValue() { 72 bool AudioDevicesPrefHandlerStub::GetAudioOutputAllowedValue() {
64 return true; 73 return true;
65 } 74 }
66 75
67 void AudioDevicesPrefHandlerStub::AddAudioPrefObserver( 76 void AudioDevicesPrefHandlerStub::AddAudioPrefObserver(
68 AudioPrefObserver* observer) { 77 AudioPrefObserver* observer) {
69 } 78 }
70 79
71 void AudioDevicesPrefHandlerStub::RemoveAudioPrefObserver( 80 void AudioDevicesPrefHandlerStub::RemoveAudioPrefObserver(
72 AudioPrefObserver* observer) { 81 AudioPrefObserver* observer) {
73 } 82 }
74 83
75 } // namespace chromeos 84 } // namespace chromeos
76 85
OLDNEW
« 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