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 CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between | 174 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between |
175 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is | 175 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is |
176 // Tab-only stuff and Pepper-only stuff being passed around to all clients, | 176 // Tab-only stuff and Pepper-only stuff being passed around to all clients, |
177 // which is icky. | 177 // which is icky. |
178 struct CONTENT_EXPORT MediaStreamRequest { | 178 struct CONTENT_EXPORT MediaStreamRequest { |
179 MediaStreamRequest( | 179 MediaStreamRequest( |
180 int render_process_id, | 180 int render_process_id, |
181 int render_view_id, | 181 int render_view_id, |
182 int page_request_id, | 182 int page_request_id, |
183 const GURL& security_origin, | 183 const GURL& security_origin, |
| 184 bool user_gesture, |
184 MediaStreamRequestType request_type, | 185 MediaStreamRequestType request_type, |
185 const std::string& requested_audio_device_id, | 186 const std::string& requested_audio_device_id, |
186 const std::string& requested_video_device_id, | 187 const std::string& requested_video_device_id, |
187 MediaStreamType audio_type, | 188 MediaStreamType audio_type, |
188 MediaStreamType video_type); | 189 MediaStreamType video_type); |
189 | 190 |
190 ~MediaStreamRequest(); | 191 ~MediaStreamRequest(); |
191 | 192 |
192 // This is the render process id for the renderer associated with generating | 193 // This is the render process id for the renderer associated with generating |
193 // frames for a MediaStream. Any indicators associated with a capture will be | 194 // frames for a MediaStream. Any indicators associated with a capture will be |
194 // displayed for this renderer. | 195 // displayed for this renderer. |
195 int render_process_id; | 196 int render_process_id; |
196 | 197 |
197 // This is the render view id for the renderer associated with generating | 198 // This is the render view id for the renderer associated with generating |
198 // frames for a MediaStream. Any indicators associated with a capture will be | 199 // frames for a MediaStream. Any indicators associated with a capture will be |
199 // displayed for this renderer. | 200 // displayed for this renderer. |
200 int render_view_id; | 201 int render_view_id; |
201 | 202 |
202 // The unique id combined with render_process_id and render_view_id for | 203 // The unique id combined with render_process_id and render_view_id for |
203 // identifying this request. This is used for cancelling request. | 204 // identifying this request. This is used for cancelling request. |
204 int page_request_id; | 205 int page_request_id; |
205 | 206 |
206 // Used by tab capture. | 207 // Used by tab capture. |
207 std::string tab_capture_device_id; | 208 std::string tab_capture_device_id; |
208 | 209 |
209 // The WebKit security origin for the current request (e.g. "html5rocks.com"). | 210 // The WebKit security origin for the current request (e.g. "html5rocks.com"). |
210 GURL security_origin; | 211 GURL security_origin; |
211 | 212 |
| 213 // Set to true if the call was made in the context of a user gesture. |
| 214 bool user_gesture; |
| 215 |
212 // Stores the type of request that was made to the media controller. Right now | 216 // Stores the type of request that was made to the media controller. Right now |
213 // this is only used to distinguish between WebRTC and Pepper requests, as the | 217 // this is only used to distinguish between WebRTC and Pepper requests, as the |
214 // latter should not be subject to user approval but only to policy check. | 218 // latter should not be subject to user approval but only to policy check. |
215 // Pepper requests are signified by the |MEDIA_OPEN_DEVICE| value. | 219 // Pepper requests are signified by the |MEDIA_OPEN_DEVICE| value. |
216 MediaStreamRequestType request_type; | 220 MediaStreamRequestType request_type; |
217 | 221 |
218 // Stores the requested raw device id for physical audio or video devices. | 222 // Stores the requested raw device id for physical audio or video devices. |
219 std::string requested_audio_device_id; | 223 std::string requested_audio_device_id; |
220 std::string requested_video_device_id; | 224 std::string requested_video_device_id; |
221 | 225 |
(...skipping 19 matching lines...) Expand all Loading... |
241 | 245 |
242 // Callback used return results of media access requests. | 246 // Callback used return results of media access requests. |
243 typedef base::Callback<void( | 247 typedef base::Callback<void( |
244 const MediaStreamDevices& devices, | 248 const MediaStreamDevices& devices, |
245 content::MediaStreamRequestResult result, | 249 content::MediaStreamRequestResult result, |
246 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; | 250 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; |
247 | 251 |
248 } // namespace content | 252 } // namespace content |
249 | 253 |
250 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 254 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
OLD | NEW |