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

Unified Diff: chromeos/audio/audio_devices_pref_handler.h

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, 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
« no previous file with comments | « ash/system/chromeos/audio/audio_detailed_view.cc ('k') | chromeos/audio/audio_devices_pref_handler_impl.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.h
diff --git a/chromeos/audio/audio_devices_pref_handler.h b/chromeos/audio/audio_devices_pref_handler.h
index 7b8d7cc7969676991d6ab8319b0f71a5286f7340..deba1e6487145f261404949c44d083367e0c8f0b 100644
--- a/chromeos/audio/audio_devices_pref_handler.h
+++ b/chromeos/audio/audio_devices_pref_handler.h
@@ -15,20 +15,6 @@ 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.
-// Note that these states enum can't be renumbered or it would break existing
-// preference.
-enum AudioDeviceState {
- AUDIO_STATE_ACTIVE = 0,
- AUDIO_STATE_INACTIVE = 1,
- AUDIO_STATE_NOT_AVAILABLE = 2,
-};
-
// Interface that handles audio preference related work, reads and writes
// audio preferences, and notifies AudioPrefObserver for audio preference
// changes.
@@ -52,9 +38,19 @@ 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;
+ // Sets the device active state in prefs.
+ // Note: |activate_by_user| indicates whether |device| is set to active
+ // by user or by priority, and it only matters when |active| is true.
+ virtual void SetDeviceActive(const AudioDevice& device,
+ bool active,
+ bool activate_by_user) = 0;
+ // Returns false if it fails to get device active state from prefs.
+ // Otherwise, returns true, pass the active state data in |*active|
+ // and |*activate_by_user|.
+ // Note: |*activate_by_user| only matters when |*active| is true.
+ virtual bool GetDeviceActive(const AudioDevice& device,
+ bool* active,
+ bool* activate_by_user) = 0;
// Reads the audio output allowed value from prefs.
virtual bool GetAudioOutputAllowedValue() = 0;
« no previous file with comments | « ash/system/chromeos/audio/audio_detailed_view.cc ('k') | chromeos/audio/audio_devices_pref_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698