OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // MediaStreamDeviceSettings is used to decide which of the available capture | 5 // MediaStreamDeviceSettings is used to decide which of the available capture |
6 // device to use as well as getting user permission to use the capture device. | 6 // device to use as well as getting user permission to use the capture device. |
7 // There will be one instance of MediaStreamDeviceSettings handling all | 7 // There will be one instance of MediaStreamDeviceSettings handling all |
8 // requests. | 8 // requests. |
9 | 9 |
10 // This version always accepts the first device in the list(s), but this will | 10 // This version always accepts the first device in the list(s), but this will |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 explicit MediaStreamDeviceSettings(SettingsRequester* requester); | 44 explicit MediaStreamDeviceSettings(SettingsRequester* requester); |
45 ~MediaStreamDeviceSettings(); | 45 ~MediaStreamDeviceSettings(); |
46 | 46 |
47 // Called when a new request of capture device usage is made. | 47 // Called when a new request of capture device usage is made. |
48 void RequestCaptureDeviceUsage(const std::string& label, | 48 void RequestCaptureDeviceUsage(const std::string& label, |
49 int render_process_id, | 49 int render_process_id, |
50 int render_view_id, | 50 int render_view_id, |
51 const StreamOptions& stream_components, | 51 const StreamOptions& stream_components, |
52 const std::string& security_origin); | 52 const std::string& security_origin); |
53 | 53 |
54 // Called as response to SettingsRequester::GetDevices. One response for each | 54 // Called to pass in an array of available devices for a request represented |
55 // call to |GetDevices| is expected. | 55 // by |label|. There could be multiple calls for a request. |
56 void AvailableDevices(const std::string& label, MediaStreamType stream_type, | 56 void AvailableDevices(const std::string& label, MediaStreamType stream_type, |
57 const StreamDeviceInfoArray& devices); | 57 const StreamDeviceInfoArray& devices); |
58 | 58 |
59 // Used for testing only. This function is called to use faked UI, which is | 59 // Used for testing only. This function is called to use faked UI, which is |
60 // needed for server based tests. The first non-opened device(s) will be | 60 // needed for server based tests. The first non-opened device(s) will be |
61 // picked. | 61 // picked. |
62 void UseFakeUI(); | 62 void UseFakeUI(); |
63 | 63 |
64 private: | 64 private: |
65 struct SettingsRequest; | 65 struct SettingsRequest; |
66 | 66 |
67 SettingsRequester* requester_; | 67 SettingsRequester* requester_; |
68 | 68 |
69 typedef std::map<std::string, SettingsRequest*> SettingsRequests; | 69 typedef std::map<std::string, SettingsRequest*> SettingsRequests; |
70 SettingsRequests requests_; | 70 SettingsRequests requests_; |
71 | 71 |
72 bool use_fake_ui_; | 72 bool use_fake_ui_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(MediaStreamDeviceSettings); | 74 DISALLOW_COPY_AND_ASSIGN(MediaStreamDeviceSettings); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace media_stream | 77 } // namespace media_stream |
78 | 78 |
79 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ | 79 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_DEVICE_SETTINGS_H_ |
OLD | NEW |