Chromium Code Reviews| Index: chromeos/audio/audio_devices_pref_handler.h |
| diff --git a/chromeos/audio/audio_devices_pref_handler.h b/chromeos/audio/audio_devices_pref_handler.h |
| index dfa582e4e57de1bcb6e7e4e88876acefd892456a..e80dc2c5adcc298de5432bd27b71c900dd547863 100644 |
| --- a/chromeos/audio/audio_devices_pref_handler.h |
| +++ b/chromeos/audio/audio_devices_pref_handler.h |
| @@ -16,6 +16,18 @@ namespace chromeos { |
| struct AudioDevice; |
| +// Used to represent an audio device's state. This state should be updated |
| +// to AUDIO_STATE_ACTIVE when it is selected as active or set to |
| +// AUDIO_STATE_INACTIVE when selected to a different device. When the audio |
| +// device is unplugged, its last active/inactive state should be stored. |
| +// At the first time an audio device got plugged, use AUDIO_STATE_NOT_AVAILABLE |
| +// as its default state value. |
|
jennyz
2015/12/17 22:50:21
Any specific reason to use AUDIO_STATE_NOT_AVAILAB
hychao
2015/12/29 10:57:25
Updated as you suggested in another comment. Thank
|
| +enum AudioDeviceState { |
| + AUDIO_STATE_ACTIVE, |
| + AUDIO_STATE_INACTIVE, |
| + AUDIO_STATE_NOT_AVAILABLE, |
| +}; |
| + |
| // Interface that handles audio preference related work, reads and writes |
| // audio preferences, and notifies AudioPrefObserver for audio preference |
| // changes. |
| @@ -39,6 +51,11 @@ class CHROMEOS_EXPORT AudioDevicesPrefHandler |
| // Sets the audio mute value to prefs for a device. |
| virtual void SetMuteValue(const AudioDevice& device, bool mute_on) = 0; |
| + virtual AudioDeviceState GetDeviceState( |
| + const AudioDevice &device) = 0; |
| + virtual void SetDeviceState(const AudioDevice& device, |
| + AudioDeviceState state) = 0; |
| + |
| // Reads the audio output allowed value from prefs. |
| virtual bool GetAudioOutputAllowedValue() = 0; |