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 #include "content/browser/renderer_host/media/media_stream_device_settings.h" | 5 #include "content/browser/renderer_host/media/media_stream_device_settings.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/task.h" | 8 #include "base/task.h" |
9 #include "content/browser/renderer_host/media/media_stream_settings_requester.h" | 9 #include "content/browser/renderer_host/media/media_stream_settings_requester.h" |
10 #include "content/common/media/media_stream_options.h" | 10 #include "content/common/media/media_stream_options.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 | 58 |
59 if (requests_.find(label) != requests_.end()) { | 59 if (requests_.find(label) != requests_.end()) { |
60 // Request with this id already exists. | 60 // Request with this id already exists. |
61 requester_->SettingsError(label); | 61 requester_->SettingsError(label); |
62 return; | 62 return; |
63 } | 63 } |
64 | 64 |
65 // Create a new request. | 65 // Create a new request. |
66 requests_.insert(std::make_pair(label, new SettingsRequest(render_process_id, | 66 requests_.insert(std::make_pair(label, new SettingsRequest(render_process_id, |
67 render_view_id, | 67 render_view_id, |
68 security_origin, | 68 security_origin, |
mflodman_chromium_OOO
2011/11/29 02:30:56
The comment in the header file needs an update reg
wjia(left Chromium)
2011/11/30 00:14:23
Done.
| |
69 request_options))); | 69 request_options))); |
70 // Ask for available devices. | |
71 if (request_options.audio) { | |
72 requester_->GetDevices(label, kAudioCapture); | |
73 } | |
74 if (request_options.video_option != StreamOptions::kNoCamera) { | |
75 requester_->GetDevices(label, kVideoCapture); | |
76 } | |
77 } | 70 } |
78 | 71 |
79 void MediaStreamDeviceSettings::AvailableDevices( | 72 void MediaStreamDeviceSettings::AvailableDevices( |
80 const std::string& label, MediaStreamType stream_type, | 73 const std::string& label, MediaStreamType stream_type, |
81 const StreamDeviceInfoArray& devices) { | 74 const StreamDeviceInfoArray& devices) { |
82 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 75 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
83 | 76 |
84 SettingsRequests::iterator request_it = requests_.find(label); | 77 SettingsRequests::iterator request_it = requests_.find(label); |
85 if (request_it == requests_.end()) { | 78 if (request_it == requests_.end()) { |
86 // Request with this id doesn't exist. | 79 // Request with this id doesn't exist. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 } | 124 } |
132 } | 125 } |
133 } | 126 } |
134 | 127 |
135 void MediaStreamDeviceSettings::UseFakeUI() { | 128 void MediaStreamDeviceSettings::UseFakeUI() { |
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 129 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
137 use_fake_ui_ = true; | 130 use_fake_ui_ = true; |
138 } | 131 } |
139 | 132 |
140 } // namespace media_stream | 133 } // namespace media_stream |
OLD | NEW |