Chromium Code Reviews| 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..bdddf340907781b0fda554376e9712384b65f5cf |
| --- /dev/null |
| +++ b/chrome/browser/media/desktop_capture_access_handler.h |
| @@ -0,0 +1,58 @@ |
| +// 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; |
| + |
| +class DesktopCaptureAccessHandler : public MediaAccessHandler { |
|
Sergey Ulanov
2015/06/01 23:39:17
Add short comment for this and other classes descr
changbin
2015/06/02 14:20:09
Done.
|
| + 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 UpdateMediaRequest(int render_process_id, |
| + int render_frame_id, |
| + int page_request_id, |
| + content::MediaStreamType stream_type, |
| + content::MediaRequestState state) override; |
| + |
| + bool IsCaptureInProgress(); |
| + |
| + private: |
| + void ProcessScreenCaptureAccessRequest( |
| + content::WebContents* web_contents, |
| + const content::MediaStreamRequest& request, |
| + const content::MediaResponseCallback& callback, |
| + const extensions::Extension* extension); |
| + |
| + // 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; |
| + DesktopCaptureSessions desktop_capture_sessions_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_MEDIA_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ |