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

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

Issue 262763004: Per navigation sticky media permissions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move IsRequestAllowedByNavigationEntry to after IsDefaultMediaAccessBlocked Created 6 years, 7 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
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 28 matching lines...) Expand all
39 MEDIA_LOOPBACK_AUDIO_CAPTURE, 39 MEDIA_LOOPBACK_AUDIO_CAPTURE,
40 40
41 NUM_MEDIA_TYPES 41 NUM_MEDIA_TYPES
42 }; 42 };
43 43
44 // Types of media stream requests that can be made to the media controller. 44 // Types of media stream requests that can be made to the media controller.
45 enum MediaStreamRequestType { 45 enum MediaStreamRequestType {
46 MEDIA_DEVICE_ACCESS = 0, 46 MEDIA_DEVICE_ACCESS = 0,
47 MEDIA_GENERATE_STREAM, 47 MEDIA_GENERATE_STREAM,
48 MEDIA_ENUMERATE_DEVICES, 48 MEDIA_ENUMERATE_DEVICES,
49 MEDIA_OPEN_DEVICE 49 MEDIA_OPEN_DEVICE // Only used in requests made by Pepper.
50 }; 50 };
51 51
52 // Facing mode for video capture. 52 // Facing mode for video capture.
53 enum VideoFacingMode { 53 enum VideoFacingMode {
54 MEDIA_VIDEO_FACING_NONE = 0, 54 MEDIA_VIDEO_FACING_NONE = 0,
55 MEDIA_VIDEO_FACING_USER, 55 MEDIA_VIDEO_FACING_USER,
56 MEDIA_VIDEO_FACING_ENVIRONMENT, 56 MEDIA_VIDEO_FACING_ENVIRONMENT,
57 MEDIA_VIDEO_FACING_LEFT, 57 MEDIA_VIDEO_FACING_LEFT,
58 MEDIA_VIDEO_FACING_RIGHT, 58 MEDIA_VIDEO_FACING_RIGHT,
59 59
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Contains the device properties of the capture device. 157 // Contains the device properties of the capture device.
158 AudioDeviceParameters input; 158 AudioDeviceParameters input;
159 159
160 // If the capture device has an associated output device (e.g. headphones), 160 // If the capture device has an associated output device (e.g. headphones),
161 // this will contain the properties for the output device. If no such device 161 // this will contain the properties for the output device. If no such device
162 // exists (e.g. webcam w/mic), then the value of this member will be all 162 // exists (e.g. webcam w/mic), then the value of this member will be all
163 // zeros. 163 // zeros.
164 AudioDeviceParameters matched_output; 164 AudioDeviceParameters matched_output;
165 }; 165 };
166 166
167 typedef std::vector<MediaStreamDevice> MediaStreamDevices; 167 class CONTENT_EXPORT MediaStreamDevices
168 : public std::vector<MediaStreamDevice> {
169 public:
170 MediaStreamDevices();
171 MediaStreamDevices(size_t count, const MediaStreamDevice& value);
172
173 // Looks for a MediaStreamDevice based on its ID.
174 // Returns NULL if not found.
175 const MediaStreamDevice* FindById(const std::string& device_id) const;
176 };
168 177
169 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap; 178 typedef std::map<MediaStreamType, MediaStreamDevices> MediaStreamDeviceMap;
170 179
171 // Represents a request for media streams (audio/video). 180 // Represents a request for media streams (audio/video).
172 // TODO(vrk): Decouple MediaStreamDevice from this header file so that 181 // TODO(vrk): Decouple MediaStreamDevice from this header file so that
173 // media_stream_options.h no longer depends on this file. 182 // media_stream_options.h no longer depends on this file.
174 // TODO(vrk,justinlin,wjia): Figure out a way to share this code cleanly between 183 // 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 184 // 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, 185 // Tab-only stuff and Pepper-only stuff being passed around to all clients,
177 // which is icky. 186 // which is icky.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 254
246 // Callback used return results of media access requests. 255 // Callback used return results of media access requests.
247 typedef base::Callback<void( 256 typedef base::Callback<void(
248 const MediaStreamDevices& devices, 257 const MediaStreamDevices& devices,
249 content::MediaStreamRequestResult result, 258 content::MediaStreamRequestResult result,
250 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; 259 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback;
251 260
252 } // namespace content 261 } // namespace content
253 262
254 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 263 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/media/media_stream_devices_controller.cc ('k') | content/public/common/media_stream_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698