| Index: chrome/browser/media/media_capture_devices_dispatcher.h
|
| diff --git a/chrome/browser/media/media_capture_devices_dispatcher.h b/chrome/browser/media/media_capture_devices_dispatcher.h
|
| index 7c823e4938719440246530f7b0dd0f9bff870634..d873660cc8282002ddec3d228e21302daf3aae10 100644
|
| --- a/chrome/browser/media/media_capture_devices_dispatcher.h
|
| +++ b/chrome/browser/media/media_capture_devices_dispatcher.h
|
| @@ -112,10 +112,8 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
|
| void DisableDeviceEnumerationForTesting();
|
|
|
| // Overridden from content::MediaObserver:
|
| - virtual void OnAudioCaptureDevicesChanged(
|
| - const content::MediaStreamDevices& devices) OVERRIDE;
|
| - virtual void OnVideoCaptureDevicesChanged(
|
| - const content::MediaStreamDevices& devices) OVERRIDE;
|
| + virtual void OnAudioCaptureDevicesChanged() OVERRIDE;
|
| + virtual void OnVideoCaptureDevicesChanged() OVERRIDE;
|
| virtual void OnMediaRequestStateChanged(
|
| int render_process_id,
|
| int render_view_id,
|
| @@ -141,6 +139,10 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
|
|
|
| bool IsDesktopCaptureInProgress();
|
|
|
| + // Only for testing.
|
| + void SetTestAudioCaptureDevices(const content::MediaStreamDevices& devices);
|
| + void SetTestVideoCaptureDevices(const content::MediaStreamDevices& devices);
|
| +
|
| private:
|
| friend struct DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
|
|
|
| @@ -196,8 +198,8 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
|
| scoped_ptr<content::MediaStreamUI> ui);
|
|
|
| // Called by the MediaObserver() functions, executed on UI thread.
|
| - void UpdateAudioDevicesOnUIThread(const content::MediaStreamDevices& devices);
|
| - void UpdateVideoDevicesOnUIThread(const content::MediaStreamDevices& devices);
|
| + void NotifyAudioDevicesChangedOnUIThread();
|
| + void NotifyVideoDevicesChangedOnUIThread();
|
| void UpdateMediaRequestStateOnUIThread(
|
| int render_process_id,
|
| int render_view_id,
|
| @@ -208,19 +210,15 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
|
| void OnCreatingAudioStreamOnUIThread(int render_process_id,
|
| int render_frame_id);
|
|
|
| - // A list of cached audio capture devices.
|
| - content::MediaStreamDevices audio_devices_;
|
| + // Only for testing, a list of cached audio capture devices.
|
| + content::MediaStreamDevices test_audio_devices_;
|
|
|
| - // A list of cached video capture devices.
|
| - content::MediaStreamDevices video_devices_;
|
| + // Only for testing, a list of cached video capture devices.
|
| + content::MediaStreamDevices test_video_devices_;
|
|
|
| // A list of observers for the device update notifications.
|
| ObserverList<Observer> observers_;
|
|
|
| - // Flag to indicate if device enumeration has been done/doing.
|
| - // Only accessed on UI thread.
|
| - bool devices_enumerated_;
|
| -
|
| // Flag used by unittests to disable device enumeration.
|
| bool is_device_enumeration_disabled_;
|
|
|
|
|