Chromium Code Reviews| Index: chromeos/audio/cras_audio_handler.h |
| diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h |
| index 633e30a33a7a2d5d9b4729f747479f23c668b79c..ea73e84e8d9916b0d79c04e374d61e25bd30f6b6 100644 |
| --- a/chromeos/audio/cras_audio_handler.h |
| +++ b/chromeos/audio/cras_audio_handler.h |
| @@ -11,6 +11,7 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "base/observer_list.h" |
| +#include "base/timer/timer.h" |
| #include "chromeos/audio/audio_device.h" |
| #include "chromeos/audio/audio_pref_observer.h" |
| #include "chromeos/dbus/audio_node.h" |
| @@ -188,6 +189,15 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, |
| // Enables error logging. |
| virtual void LogErrors(); |
| + // If necessary, sets the starting point for re-discovering the active HDMI |
| + // output device caused by device entering/exiting docking mode, HDMI display |
| + // changing resolution, or chromeos device suspend/resume. If |
| + // |force_rediscovering| is true, it will force to set the starting point for |
| + // re-discovering the active HDMI output device again if it has been in the |
| + // middle of rediscovering the HDMI active output device. |
| + virtual void SetActiveHDMIOutoutRediscoveringIfNecessary( |
| + bool force_rediscovering); |
| + |
| protected: |
| explicit CrasAudioHandler( |
| scoped_refptr<AudioDevicesPrefHandler> audio_pref_handler); |
| @@ -293,6 +303,16 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, |
| // Removes |node_id| from additional active nodes. |
| void RemoveActiveNodeInternal(uint64_t node_id, bool notify); |
| + void UpdateAudioAfterHDMIRediscoverGracePeriod(); |
| + |
| + bool IsHDMIPrimaryOutputDevice() const; |
| + |
| + void StartHDMIRediscoverGracePeriod(); |
| + |
| + bool hdmi_rediscovering() const { return hdmi_rediscovering_; } |
| + |
| + void SetHDMIRediscoverGracePeriodForTesting(int during_in_ms); |
|
cychiang
2015/06/26 10:00:21
should name it duration_in_ms ?
jennyz
2015/06/29 20:49:41
Done.
|
| + |
| enum DeviceStatus { |
| OLD_DEVICE, |
| NEW_DEVICE, |
| @@ -328,6 +348,11 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer, |
| // Failures are not logged at startup, since CRAS may not be running yet. |
| bool log_errors_; |
| + // Timer for HDMI re-discovering grace period. |
| + base::OneShotTimer<CrasAudioHandler> hdmi_rediscover_timer_; |
| + int hdmi_rediscover_grace_period_duration_in_ms_; |
| + bool hdmi_rediscovering_; |
| + |
| base::WeakPtrFactory<CrasAudioHandler> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(CrasAudioHandler); |