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

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

Issue 1095393004: Refactor: Make MediaCaptureDevicesDispatcher have pluggable handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tryjob error. Created 5 years, 6 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: chrome/browser/media/media_access_handler.h
diff --git a/chrome/browser/media/media_access_handler.h b/chrome/browser/media/media_access_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc7b8556380abbca69baa61a9b6ccb60b423bb22
--- /dev/null
+++ b/chrome/browser/media/media_access_handler.h
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_MEDIA_ACCESS_HANDLER_H_
+#define CHROME_BROWSER_MEDIA_MEDIA_ACCESS_HANDLER_H_
+
+#include "base/callback.h"
+#include "content/public/browser/media_request_state.h"
+#include "content/public/common/media_stream_request.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace extensions {
+class Extension;
+}
+
+// Interface for handling media access requests that are propagated from
+// MediaCaptureDevicesDispatcher.
+class MediaAccessHandler {
+ public:
+ MediaAccessHandler() {}
+ virtual ~MediaAccessHandler() {}
+
+ // Check if the media stream type is supported by MediaAccessHandler.
+ virtual bool SupportsStreamType(const content::MediaStreamType type,
+ const extensions::Extension* extension) = 0;
+ // Check media access permission. |extension| is set to NULL if request was
+ // made from a drive-by page.
+ virtual bool CheckMediaAccessPermission(
+ content::WebContents* web_contents,
+ const GURL& security_origin,
+ content::MediaStreamType type,
+ const extensions::Extension* extension) = 0;
+ // Process media access requests. |extension| is set to NULL if request was
+ // made from a drive-by page.
+ virtual void HandleRequest(content::WebContents* web_contents,
+ const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback,
+ const extensions::Extension* extension) = 0;
+ // Update media request state. Called on UI thread.
+ virtual void UpdateMediaRequestState(int render_process_id,
+ int render_frame_id,
+ int page_request_id,
+ content::MediaStreamType stream_type,
+ content::MediaRequestState state) {}
+};
+
+#endif // CHROME_BROWSER_MEDIA_MEDIA_ACCESS_HANDLER_H_
« no previous file with comments | « chrome/browser/media/extension_media_access_handler.cc ('k') | chrome/browser/media/media_capture_devices_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698