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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between | 158 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between |
159 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is | 159 // vanilla WebRTC, Tab Capture, and Pepper Video Capture. Right now there is |
160 // Tab-only stuff and Pepper-only stuff being passed around to all clients, | 160 // Tab-only stuff and Pepper-only stuff being passed around to all clients, |
161 // which is icky. | 161 // which is icky. |
162 struct CONTENT_EXPORT MediaStreamRequest { | 162 struct CONTENT_EXPORT MediaStreamRequest { |
163 MediaStreamRequest( | 163 MediaStreamRequest( |
164 int render_process_id, | 164 int render_process_id, |
165 int render_view_id, | 165 int render_view_id, |
166 int page_request_id, | 166 int page_request_id, |
167 const GURL& security_origin, | 167 const GURL& security_origin, |
| 168 bool user_gesture, |
168 MediaStreamRequestType request_type, | 169 MediaStreamRequestType request_type, |
169 const std::string& requested_audio_device_id, | 170 const std::string& requested_audio_device_id, |
170 const std::string& requested_video_device_id, | 171 const std::string& requested_video_device_id, |
171 MediaStreamType audio_type, | 172 MediaStreamType audio_type, |
172 MediaStreamType video_type); | 173 MediaStreamType video_type); |
173 | 174 |
174 ~MediaStreamRequest(); | 175 ~MediaStreamRequest(); |
175 | 176 |
176 // This is the render process id for the renderer associated with generating | 177 // This is the render process id for the renderer associated with generating |
177 // frames for a MediaStream. Any indicators associated with a capture will be | 178 // frames for a MediaStream. Any indicators associated with a capture will be |
178 // displayed for this renderer. | 179 // displayed for this renderer. |
179 int render_process_id; | 180 int render_process_id; |
180 | 181 |
181 // This is the render view id for the renderer associated with generating | 182 // This is the render view id for the renderer associated with generating |
182 // frames for a MediaStream. Any indicators associated with a capture will be | 183 // frames for a MediaStream. Any indicators associated with a capture will be |
183 // displayed for this renderer. | 184 // displayed for this renderer. |
184 int render_view_id; | 185 int render_view_id; |
185 | 186 |
186 // The unique id combined with render_process_id and render_view_id for | 187 // The unique id combined with render_process_id and render_view_id for |
187 // identifying this request. This is used for cancelling request. | 188 // identifying this request. This is used for cancelling request. |
188 int page_request_id; | 189 int page_request_id; |
189 | 190 |
190 // Used by tab capture. | 191 // Used by tab capture. |
191 std::string tab_capture_device_id; | 192 std::string tab_capture_device_id; |
192 | 193 |
193 // The WebKit security origin for the current request (e.g. "html5rocks.com"). | 194 // The WebKit security origin for the current request (e.g. "html5rocks.com"). |
194 GURL security_origin; | 195 GURL security_origin; |
195 | 196 |
| 197 // Set to true if the call was made in the context of a user gesture. |
| 198 bool user_gesture; |
| 199 |
196 // Stores the type of request that was made to the media controller. Right now | 200 // Stores the type of request that was made to the media controller. Right now |
197 // this is only used to distinguish between WebRTC and Pepper requests, as the | 201 // this is only used to distinguish between WebRTC and Pepper requests, as the |
198 // latter should not be subject to user approval but only to policy check. | 202 // latter should not be subject to user approval but only to policy check. |
199 // Pepper requests are signified by the |MEDIA_OPEN_DEVICE| value. | 203 // Pepper requests are signified by the |MEDIA_OPEN_DEVICE| value. |
200 MediaStreamRequestType request_type; | 204 MediaStreamRequestType request_type; |
201 | 205 |
202 // Stores the requested raw device id for physical audio or video devices. | 206 // Stores the requested raw device id for physical audio or video devices. |
203 std::string requested_audio_device_id; | 207 std::string requested_audio_device_id; |
204 std::string requested_video_device_id; | 208 std::string requested_video_device_id; |
205 | 209 |
(...skipping 17 matching lines...) Expand all Loading... |
223 }; | 227 }; |
224 | 228 |
225 // Callback used return results of media access requests. | 229 // Callback used return results of media access requests. |
226 typedef base::Callback<void( | 230 typedef base::Callback<void( |
227 const MediaStreamDevices& devices, | 231 const MediaStreamDevices& devices, |
228 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; | 232 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; |
229 | 233 |
230 } // namespace content | 234 } // namespace content |
231 | 235 |
232 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ | 236 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ |
OLD | NEW |