OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 6 #define CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const content::MediaStreamRequest& request, | 83 const content::MediaStreamRequest& request, |
84 const content::MediaResponseCallback& callback, | 84 const content::MediaResponseCallback& callback, |
85 const extensions::Extension* extension); | 85 const extensions::Extension* extension); |
86 | 86 |
87 // Checks if we have media access permission. Note that this only checks the | 87 // Checks if we have media access permission. Note that this only checks the |
88 // settings and does not query the user. | 88 // settings and does not query the user. |
89 bool CheckMediaAccessPermission(content::BrowserContext* browser_context, | 89 bool CheckMediaAccessPermission(content::BrowserContext* browser_context, |
90 const GURL& security_origin, | 90 const GURL& security_origin, |
91 content::MediaStreamType type); | 91 content::MediaStreamType type); |
92 | 92 |
| 93 // Method called from WebCapturerDelegate implementations to check media |
| 94 // access permission. Note that this does not query the user. |extension| is |
| 95 // set to NULL if request was made from a drive-by page. |
| 96 bool CheckMediaAccessPermission(content::WebContents* web_contents, |
| 97 const GURL& security_origin, |
| 98 content::MediaStreamType type, |
| 99 const extensions::Extension* extension); |
| 100 |
93 // Helper to get the default devices which can be used by the media request. | 101 // Helper to get the default devices which can be used by the media request. |
94 // Uses the first available devices if the default devices are not available. | 102 // Uses the first available devices if the default devices are not available. |
95 // If the return list is empty, it means there is no available device on the | 103 // If the return list is empty, it means there is no available device on the |
96 // OS. | 104 // OS. |
97 // Called on the UI thread. | 105 // Called on the UI thread. |
98 void GetDefaultDevicesForProfile(Profile* profile, | 106 void GetDefaultDevicesForProfile(Profile* profile, |
99 bool audio, | 107 bool audio, |
100 bool video, | 108 bool video, |
101 content::MediaStreamDevices* devices); | 109 content::MediaStreamDevices* devices); |
102 | 110 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 int render_frame_id; | 253 int render_frame_id; |
246 int page_request_id; | 254 int page_request_id; |
247 }; | 255 }; |
248 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; | 256 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; |
249 DesktopCaptureSessions desktop_capture_sessions_; | 257 DesktopCaptureSessions desktop_capture_sessions_; |
250 | 258 |
251 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); | 259 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); |
252 }; | 260 }; |
253 | 261 |
254 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 262 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
OLD | NEW |