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

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

Issue 180633008: Add different error codes for getUserMedia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments 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
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 enum VideoFacingMode { 52 enum VideoFacingMode {
53 MEDIA_VIDEO_FACING_NONE = 0, 53 MEDIA_VIDEO_FACING_NONE = 0,
54 MEDIA_VIDEO_FACING_USER, 54 MEDIA_VIDEO_FACING_USER,
55 MEDIA_VIDEO_FACING_ENVIRONMENT, 55 MEDIA_VIDEO_FACING_ENVIRONMENT,
56 MEDIA_VIDEO_FACING_LEFT, 56 MEDIA_VIDEO_FACING_LEFT,
57 MEDIA_VIDEO_FACING_RIGHT, 57 MEDIA_VIDEO_FACING_RIGHT,
58 58
59 NUM_MEDIA_VIDEO_FACING_MODE 59 NUM_MEDIA_VIDEO_FACING_MODE
60 }; 60 };
61 61
62 enum MediaStreamRequestResult {
63 MEDIA_DEVICE_OK = 0,
64 MEDIA_DEVICE_PERMISSION_DENIED,
65 MEDIA_DEVICE_PERMISSION_DISMISSED,
66 MEDIA_DEVICE_INVALID_STATE,
67 MEDIA_DEVICE_NO_HARDWARE,
68 MEDIA_DEVICE_INVALID_SECURITY_ORIGIN,
69 MEDIA_DEVICE_TAB_CAPTURE_FAILURE,
70 MEDIA_DEVICE_SCREEN_CAPTURE_FAILURE,
71 MEDIA_DEVICE_CAPTURE_FAILURE,
72 MEDIA_DEVICE_TRACK_START_FAILURE,
73
74 NUM_MEDIA_REQUEST_RESULTS
75 };
76
62 // Convenience predicates to determine whether the given type represents some 77 // Convenience predicates to determine whether the given type represents some
63 // audio or some video device. 78 // audio or some video device.
64 CONTENT_EXPORT bool IsAudioMediaType(MediaStreamType type); 79 CONTENT_EXPORT bool IsAudioMediaType(MediaStreamType type);
65 CONTENT_EXPORT bool IsVideoMediaType(MediaStreamType type); 80 CONTENT_EXPORT bool IsVideoMediaType(MediaStreamType type);
66 81
67 // TODO(xians): Change the structs to classes. 82 // TODO(xians): Change the structs to classes.
68 // Represents one device in a request for media stream(s). 83 // Represents one device in a request for media stream(s).
69 struct CONTENT_EXPORT MediaStreamDevice { 84 struct CONTENT_EXPORT MediaStreamDevice {
70 MediaStreamDevice(); 85 MediaStreamDevice();
71 86
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 virtual ~MediaStreamUI() {} 233 virtual ~MediaStreamUI() {}
219 234
220 // Called when MediaStream capturing is started. Chrome layer can call |stop| 235 // Called when MediaStream capturing is started. Chrome layer can call |stop|
221 // to stop the stream. 236 // to stop the stream.
222 virtual void OnStarted(const base::Closure& stop) = 0; 237 virtual void OnStarted(const base::Closure& stop) = 0;
223 }; 238 };
224 239
225 // Callback used return results of media access requests. 240 // Callback used return results of media access requests.
226 typedef base::Callback<void( 241 typedef base::Callback<void(
227 const MediaStreamDevices& devices, 242 const MediaStreamDevices& devices,
243 content::MediaStreamRequestResult result,
228 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback; 244 scoped_ptr<MediaStreamUI> ui)> MediaResponseCallback;
229 245
230 } // namespace content 246 } // namespace content
231 247
232 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_ 248 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
OLDNEW
« no previous file with comments | « content/public/browser/web_contents_delegate.cc ('k') | content/public/common/media_stream_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698