Loosen up heuristics for detecting account creation forms.
[chromium-blink-merge.git] / content / public / common / media_stream_request.h
blobccd868f39ff7e523666bd8a4807d4d933aaf01d6
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
6 #define CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_
8 #include <map>
9 #include <string>
10 #include <vector>
12 #include "base/basictypes.h"
13 #include "content/common/content_export.h"
14 #include "googleurl/src/gurl.h"
16 namespace content {
18 // Types of media streams.
19 enum MediaStreamDeviceType {
20 MEDIA_NO_SERVICE = 0,
22 // A device provided by the operating system (e.g., webcam input).
23 MEDIA_DEVICE_AUDIO_CAPTURE,
24 MEDIA_DEVICE_VIDEO_CAPTURE,
26 // Mirroring of a browser tab.
27 MEDIA_TAB_AUDIO_CAPTURE,
28 MEDIA_TAB_VIDEO_CAPTURE,
30 NUM_MEDIA_TYPES
33 // Convenience predicates to determine whether the given type represents some
34 // audio or some video device.
35 CONTENT_EXPORT bool IsAudioMediaType(MediaStreamDeviceType type);
36 CONTENT_EXPORT bool IsVideoMediaType(MediaStreamDeviceType type);
38 // TODO(xians): Change the structs to classes.
39 // Represents one device in a request for media stream(s).
40 struct CONTENT_EXPORT MediaStreamDevice {
41 MediaStreamDevice(
42 MediaStreamDeviceType type,
43 const std::string& device_id,
44 const std::string& name);
46 ~MediaStreamDevice();
48 // The device's type.
49 MediaStreamDeviceType type;
51 // The device's unique ID.
52 std::string device_id;
54 // The device's "friendly" name. Not guaranteed to be unique.
55 std::string name;
58 typedef std::vector<MediaStreamDevice> MediaStreamDevices;
60 typedef std::map<MediaStreamDeviceType, MediaStreamDevices>
61 MediaStreamDeviceMap;
63 // Represents a request for media streams (audio/video).
64 struct CONTENT_EXPORT MediaStreamRequest {
65 MediaStreamRequest(
66 int render_process_id,
67 int render_view_id,
68 const GURL& security_origin);
70 ~MediaStreamRequest();
72 // The render process id generating this request.
73 int render_process_id;
75 // The render view id generating this request.
76 int render_view_id;
78 // The WebKit security origin for the current request (e.g. "html5rocks.com").
79 GURL security_origin;
81 // A list of devices present on the user's computer, for each device type
82 // requested.
83 // All the elements in this map will be deleted in ~MediaStreamRequest().
84 MediaStreamDeviceMap devices;
87 } // namespace content
89 #endif // CONTENT_PUBLIC_COMMON_MEDIA_STREAM_REQUEST_H_