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

Unified Diff: chrome/browser/media/media_capture_devices_dispatcher.h

Issue 183743021: Implement MediaCaptureDevices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try again Created 6 years, 9 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 | « no previous file | chrome/browser/media/media_capture_devices_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | chrome/browser/media/media_capture_devices_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698