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 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.
| |
15 public: | |
16 DesktopCaptureAccessHandler(); | |
17 ~DesktopCaptureAccessHandler() override; | |
18 | |
19 // MediaAccessHandler implementation. | |
20 bool SupportsStreamType(const content::MediaStreamType type, | |
21 const extensions::Extension* extension) override; | |
22 bool CheckMediaAccessPermission( | |
23 content::WebContents* web_contents, | |
24 const GURL& security_origin, | |
25 content::MediaStreamType type, | |
26 const extensions::Extension* extension) override; | |
27 void HandleRequest(content::WebContents* web_contents, | |
28 const content::MediaStreamRequest& request, | |
29 const content::MediaResponseCallback& callback, | |
30 const extensions::Extension* extension) override; | |
31 void UpdateMediaRequest(int render_process_id, | |
32 int render_frame_id, | |
33 int page_request_id, | |
34 content::MediaStreamType stream_type, | |
35 content::MediaRequestState state) override; | |
36 | |
37 bool IsCaptureInProgress(); | |
38 | |
39 private: | |
40 void ProcessScreenCaptureAccessRequest( | |
41 content::WebContents* web_contents, | |
42 const content::MediaStreamRequest& request, | |
43 const content::MediaResponseCallback& callback, | |
44 const extensions::Extension* extension); | |
45 | |
46 // Tracks MEDIA_DESKTOP_VIDEO_CAPTURE sessions which reach the | |
47 // MEDIA_REQUEST_STATE_DONE state. Sessions are remove when | |
48 // MEDIA_REQUEST_STATE_CLOSING is encountered. | |
49 struct DesktopCaptureSession { | |
50 int render_process_id; | |
51 int render_frame_id; | |
52 int page_request_id; | |
53 }; | |
54 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; | |
55 DesktopCaptureSessions desktop_capture_sessions_; | |
56 }; | |
57 | |
58 #endif // CHROME_BROWSER_MEDIA_DESKTOP_CAPTURE_ACCESS_HANDLER_H_ | |
OLD | NEW |