Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_MEDIA_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_MEDIA_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 | |
| 10 #include "chrome/browser/media/media_access_handler.h" | |
| 11 | |
| 12 class DesktopStreamsRegistry; | |
| 13 | |
| 14 // MediaAccessHandler for DesktopCapture API. | |
| 15 class DesktopCaptureAccessHandler : public MediaAccessHandler { | |
| 16 public: | |
| 17 DesktopCaptureAccessHandler(); | |
| 18 ~DesktopCaptureAccessHandler() override; | |
| 19 | |
| 20 // MediaAccessHandler implementation. | |
| 21 bool SupportsStreamType(const content::MediaStreamType type, | |
| 22 const extensions::Extension* extension) override; | |
| 23 bool CheckMediaAccessPermission( | |
| 24 content::WebContents* web_contents, | |
| 25 const GURL& security_origin, | |
| 26 content::MediaStreamType type, | |
| 27 const extensions::Extension* extension) override; | |
| 28 void HandleRequest(content::WebContents* web_contents, | |
| 29 const content::MediaStreamRequest& request, | |
| 30 const content::MediaResponseCallback& callback, | |
| 31 const extensions::Extension* extension) override; | |
| 32 void UpdateMediaRequestState(int render_process_id, | |
| 33 int render_frame_id, | |
| 34 int page_request_id, | |
| 35 content::MediaStreamType stream_type, | |
| 36 content::MediaRequestState state) override; | |
| 37 | |
| 38 bool IsCaptureInProgress(); | |
| 39 | |
| 40 private: | |
| 41 void ProcessScreenCaptureAccessRequest( | |
| 42 content::WebContents* web_contents, | |
| 43 const content::MediaStreamRequest& request, | |
| 44 const content::MediaResponseCallback& callback, | |
| 45 const extensions::Extension* extension); | |
| 46 | |
| 47 // Tracks MEDIA_DESKTOP_VIDEO_CAPTURE sessions which reach the | |
| 48 // MEDIA_REQUEST_STATE_DONE state. Sessions are remove when | |
| 49 // MEDIA_REQUEST_STATE_CLOSING is encountered. | |
| 50 struct DesktopCaptureSession { | |
| 51 int render_process_id; | |
| 52 int render_frame_id; | |
| 53 int page_request_id; | |
| 54 }; | |
| 55 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; | |
|
Sergey Ulanov
2015/06/03 22:31:57
nit: move DesktopCaptureSession and this typedef a
changbin
2015/06/05 06:40:33
Done.
| |
| 56 DesktopCaptureSessions desktop_capture_sessions_; | |
| 57 }; | |
| 58 | |
| 59 #endif // CHROME_BROWSER_MEDIA_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ | |
| OLD | NEW |