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

Unified Diff: chromeos/audio/audio_devices_pref_handler.h

Issue 1380103003: Store audio device's active state in preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 2347aad6a467c1e7956d7ec9537e8bf186b9d12f..0be562143a2b36b0c6b3da1dafa65e4a1e593cd2 100644
--- a/chromeos/audio/audio_devices_pref_handler.h
+++ b/chromeos/audio/audio_devices_pref_handler.h
@@ -15,6 +15,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.
+// The default value of device state will be AUDIO_STATE_NOT_AVAILABLE if
+// the device is not found in the pref settings.
+enum AudioDeviceState {
+ AUDIO_STATE_ACTIVE,
Daniel Erat 2016/01/07 17:31:12 explicitly specify the numbers for these and docum
hychao 2016/01/11 07:02:32 Done.
+ 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.
@@ -38,6 +50,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;

Powered by Google App Engine
This is Rietveld 408576698