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

Unified Diff: chrome/browser/media/desktop_capture_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
« no previous file with comments | « no previous file | chrome/browser/media/desktop_capture_access_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/desktop_capture_access_handler.h
diff --git a/chrome/browser/media/desktop_capture_access_handler.h b/chrome/browser/media/desktop_capture_access_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..c0ab0ec3ac6dbcea3852a9a4d95fca7596964865
--- /dev/null
+++ b/chrome/browser/media/desktop_capture_access_handler.h
@@ -0,0 +1,60 @@
+// 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_DESKTOP_CAPTURE_ACCESS_HANDLER_H_
+#define CHROME_BROWSER_MEDIA_DESKTOP_CAPTURE_ACCESS_HANDLER_H_
+
+#include <list>
+
+#include "chrome/browser/media/media_access_handler.h"
+
+class DesktopStreamsRegistry;
+
+// MediaAccessHandler for DesktopCapture API.
+class DesktopCaptureAccessHandler : public MediaAccessHandler {
+ public:
+ DesktopCaptureAccessHandler();
+ ~DesktopCaptureAccessHandler() override;
+
+ // MediaAccessHandler implementation.
+ bool SupportsStreamType(const content::MediaStreamType type,
+ const extensions::Extension* extension) override;
+ bool CheckMediaAccessPermission(
+ content::WebContents* web_contents,
+ const GURL& security_origin,
+ content::MediaStreamType type,
+ const extensions::Extension* extension) override;
+ void HandleRequest(content::WebContents* web_contents,
+ const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback,
+ const extensions::Extension* extension) override;
+ void UpdateMediaRequestState(int render_process_id,
+ int render_frame_id,
+ int page_request_id,
+ content::MediaStreamType stream_type,
+ content::MediaRequestState state) override;
+
+ bool IsCaptureInProgress();
+
+ private:
+ // Tracks MEDIA_DESKTOP_VIDEO_CAPTURE sessions which reach the
+ // MEDIA_REQUEST_STATE_DONE state. Sessions are remove when
+ // MEDIA_REQUEST_STATE_CLOSING is encountered.
+ struct DesktopCaptureSession {
+ int render_process_id;
+ int render_frame_id;
+ int page_request_id;
+ };
+ typedef std::list<DesktopCaptureSession> DesktopCaptureSessions;
+
+ void ProcessScreenCaptureAccessRequest(
+ content::WebContents* web_contents,
+ const content::MediaStreamRequest& request,
+ const content::MediaResponseCallback& callback,
+ const extensions::Extension* extension);
+
+ DesktopCaptureSessions desktop_capture_sessions_;
+};
+
+#endif // CHROME_BROWSER_MEDIA_DESKTOP_CAPTURE_ACCESS_HANDLER_H_
« no previous file with comments | « no previous file | chrome/browser/media/desktop_capture_access_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698