Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "content/browser/renderer_host/media/media_stream_ui_controller.h" | 5 #include "content/browser/renderer_host/media/media_stream_ui_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 ProcessNextRequestForView(request->render_process_id, | 192 ProcessNextRequestForView(request->render_process_id, |
| 193 request->render_view_id); | 193 request->render_view_id); |
| 194 | 194 |
| 195 if (devices.size() > 0) { | 195 if (devices.size() > 0) { |
| 196 // Build a list of "full" device objects for the accepted devices. | 196 // Build a list of "full" device objects for the accepted devices. |
| 197 StreamDeviceInfoArray device_list; | 197 StreamDeviceInfoArray device_list; |
| 198 // TODO(xians): figure out if it is all right to hard code in_use to false, | 198 // TODO(xians): figure out if it is all right to hard code in_use to false, |
| 199 // though DevicesAccepted seems to do so. | 199 // though DevicesAccepted seems to do so. |
| 200 for (MediaStreamDevices::const_iterator dev = devices.begin(); | 200 for (MediaStreamDevices::const_iterator dev = devices.begin(); |
| 201 dev != devices.end(); ++dev) { | 201 dev != devices.end(); ++dev) { |
| 202 device_list.push_back(StreamDeviceInfo( | 202 if (dev->type == content::MEDIA_DEVICE_AUDIO_CAPTURE) |
|
tommi (sloooow) - chröme
2013/01/15 17:43:49
{}
henrika (OOO until Aug 14)
2013/01/16 16:37:17
Done.
| |
| 203 dev->type, dev->name, dev->id, false)); | 203 device_list.push_back(StreamDeviceInfo( |
| 204 content::MEDIA_DEVICE_AUDIO_CAPTURE, dev->name, dev->id, | |
| 205 dev->sample_rate, dev->channel_layout, false)); | |
| 206 else | |
| 207 device_list.push_back(StreamDeviceInfo( | |
| 208 dev->type, dev->name, dev->id, false)); | |
| 204 } | 209 } |
| 205 | 210 |
| 206 requester_->DevicesAccepted(label, device_list); | 211 requester_->DevicesAccepted(label, device_list); |
| 207 } else { | 212 } else { |
| 208 requester_->SettingsError(label); | 213 requester_->SettingsError(label); |
| 209 } | 214 } |
| 210 } | 215 } |
| 211 | 216 |
| 212 void MediaStreamUIController::NotifyUIIndicatorDevicesOpened( | 217 void MediaStreamUIController::NotifyUIIndicatorDevicesOpened( |
| 213 int render_process_id, | 218 int render_process_id, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 } | 342 } |
| 338 } | 343 } |
| 339 | 344 |
| 340 BrowserThread::PostTask( | 345 BrowserThread::PostTask( |
| 341 BrowserThread::IO, FROM_HERE, | 346 BrowserThread::IO, FROM_HERE, |
| 342 base::Bind(&MediaStreamUIController::PostResponse, | 347 base::Bind(&MediaStreamUIController::PostResponse, |
| 343 weak_ptr_factory_.GetWeakPtr(), label, devices_to_use)); | 348 weak_ptr_factory_.GetWeakPtr(), label, devices_to_use)); |
| 344 } | 349 } |
| 345 | 350 |
| 346 } // namespace content | 351 } // namespace content |
| OLD | NEW |