Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: content/public/common/media_stream_request.h

Issue 185863003: [Media] Add user gesture reporting for API calls to midi and media streams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test merge Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/browser/browser_context.h ('k') | content/public/common/media_stream_request.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « content/public/browser/browser_context.h ('k') | content/public/common/media_stream_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698