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. |
| 95 bool CheckMediaAccessPermission(content::WebContents* web_contents, |
| 96 const GURL& security_origin, |
| 97 content::MediaStreamType type); |
| 98 |
| 99 // Same as above but for an |extension|, which may not be NULL. |
| 100 #if defined(ENABLE_EXTENSIONS) |
| 101 bool CheckMediaAccessPermission(content::WebContents* web_contents, |
| 102 const GURL& security_origin, |
| 103 content::MediaStreamType type, |
| 104 const extensions::Extension* extension); |
| 105 #endif |
| 106 |
93 // Helper to get the default devices which can be used by the media request. | 107 // 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. | 108 // 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 | 109 // If the return list is empty, it means there is no available device on the |
96 // OS. | 110 // OS. |
97 // Called on the UI thread. | 111 // Called on the UI thread. |
98 void GetDefaultDevicesForProfile(Profile* profile, | 112 void GetDefaultDevicesForProfile(Profile* profile, |
99 bool audio, | 113 bool audio, |
100 bool video, | 114 bool video, |
101 content::MediaStreamDevices* devices); | 115 content::MediaStreamDevices* devices); |
102 | 116 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 int render_frame_id; | 250 int render_frame_id; |
237 int page_request_id; | 251 int page_request_id; |
238 }; | 252 }; |
239 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; | 253 typedef std::list<DesktopCaptureSession> DesktopCaptureSessions; |
240 DesktopCaptureSessions desktop_capture_sessions_; | 254 DesktopCaptureSessions desktop_capture_sessions_; |
241 | 255 |
242 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); | 256 DISALLOW_COPY_AND_ASSIGN(MediaCaptureDevicesDispatcher); |
243 }; | 257 }; |
244 | 258 |
245 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ | 259 #endif // CHROME_BROWSER_MEDIA_MEDIA_CAPTURE_DEVICES_DISPATCHER_H_ |
OLD | NEW |