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

Unified Diff: content/browser/renderer_host/media/media_stream_ui_proxy.h

Issue 562263002: Check media permissions through RenderFrameHostDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render_frame_get_sources
Patch Set: git cl format. Don't blame me. Created 6 years, 3 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
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..61ef195dd3536900f5a209357a5289e8bdae5813 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
+ // 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_;

Powered by Google App Engine
This is Rietveld 408576698