Index: content/browser/renderer_host/media/media_stream_ui_proxy.h |
diff --git a/content/browser/renderer_host/media/media_stream_ui_proxy.h b/content/browser/renderer_host/media/media_stream_ui_proxy.h |
index 810a29a5d812568f2397ed6e5dbe2ef2699d9523..58f55605174ef264f3dbb1a21ee983569b2a46b9 100644 |
--- a/content/browser/renderer_host/media/media_stream_ui_proxy.h |
+++ b/content/browser/renderer_host/media/media_stream_ui_proxy.h |
@@ -41,6 +41,15 @@ class CONTENT_EXPORT MediaStreamUIProxy { |
virtual void RequestAccess(const MediaStreamRequest& request, |
const ResponseCallback& response_callback); |
+ // Checks if we have permission to access the microphone or camera. Note that |
+ // this does not query the user. |type| must be MEDIA_DEVICE_AUDIO_CAPTURE |
perkj_chrome
2014/09/15 12:06:25
Can you expand this. Ie, When should this be calle
Henrik Grunell
2014/09/15 13:45:17
I added that this checks any stored settings. Not
perkj_chrome
2014/09/15 15:08:55
I was wondering about the " Note that
45 // th
Henrik Grunell
2014/09/15 18:20:15
Yes, exactly. Either if the user has granted acces
|
+ // or MEDIA_DEVICE_VIDEO_CAPTURE. |
+ virtual void CheckAccess(const GURL& security_origin, |
+ MediaStreamType type, |
+ int render_process_id, |
+ int render_frame_id, |
+ const base::Callback<void(bool)>& callback); |
+ |
// Notifies the UI that the MediaStream has been started. Must be called after |
// access has been approved using RequestAccess(). |stop_callback| is be |
// called on the IO thread after the user has requests the stream to be |
@@ -65,6 +74,8 @@ class CONTENT_EXPORT MediaStreamUIProxy { |
void ProcessStopRequestFromUI(); |
void OnWindowId(const WindowIdCallback& window_id_callback, |
gfx::NativeViewId* window_id); |
+ void OnCheckedAccess(const base::Callback<void(bool)>& callback, |
+ bool have_access); |
scoped_ptr<Core, content::BrowserThread::DeleteOnUIThread> core_; |
ResponseCallback response_callback_; |
@@ -81,17 +92,29 @@ class CONTENT_EXPORT FakeMediaStreamUIProxy : public MediaStreamUIProxy { |
virtual ~FakeMediaStreamUIProxy(); |
void SetAvailableDevices(const MediaStreamDevices& devices); |
+ void SetMicAccess(bool access); |
+ void SetCameraAccess(bool access); |
// MediaStreamUIProxy overrides. |
virtual void RequestAccess( |
const MediaStreamRequest& request, |
const ResponseCallback& response_callback) OVERRIDE; |
+ virtual void CheckAccess(const GURL& security_origin, |
+ MediaStreamType type, |
+ int render_process_id, |
+ int render_frame_id, |
+ const base::Callback<void(bool)>& callback) OVERRIDE; |
virtual void OnStarted(const base::Closure& stop_callback, |
const WindowIdCallback& window_id_callback) OVERRIDE; |
private: |
+ // This is used for RequestAccess(). |
MediaStreamDevices devices_; |
+ // These are used for CheckAccess(). |
+ bool mic_access_; |
+ bool camera_access_; |
+ |
DISALLOW_COPY_AND_ASSIGN(FakeMediaStreamUIProxy); |
}; |