Index: chrome/browser/media/media_stream_devices_controller.cc |
diff --git a/chrome/browser/media/media_stream_devices_controller.cc b/chrome/browser/media/media_stream_devices_controller.cc |
index 9f2b85753e3ce54137557331b0fe00a27e84b74d..a1eac0ae7bc1d5fd9e4ad8f3366f00a296aa1411 100644 |
--- a/chrome/browser/media/media_stream_devices_controller.cc |
+++ b/chrome/browser/media/media_stream_devices_controller.cc |
@@ -188,7 +188,8 @@ void MediaStreamDevicesController::Accept(bool update_content_setting) { |
const content::MediaStreamDevice* device = NULL; |
// For open device request pick the desired device or fall back to the |
// first available of the given type. |
- if (request_.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE) { |
+ if (audio_allowed && |
+ request_.audio_type == content::MEDIA_DEVICE_AUDIO_CAPTURE) { |
device = MediaCaptureDevicesDispatcher::GetInstance()-> |
GetRequestedAudioDevice(request_.requested_audio_device_id); |
// TODO(wjia): Confirm this is the intended behavior. |
@@ -196,7 +197,8 @@ void MediaStreamDevicesController::Accept(bool update_content_setting) { |
device = MediaCaptureDevicesDispatcher::GetInstance()-> |
GetFirstAvailableAudioDevice(); |
} |
- } else if (request_.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE) { |
+ } else if (video_allowed && |
+ request_.video_type == content::MEDIA_DEVICE_VIDEO_CAPTURE) { |
// Pepper API opens only one device at a time. |
device = MediaCaptureDevicesDispatcher::GetInstance()-> |
GetRequestedVideoDevice(request_.requested_video_device_id); |
@@ -214,7 +216,7 @@ void MediaStreamDevicesController::Accept(bool update_content_setting) { |
bool needs_video_device = video_allowed; |
wjia(left Chromium)
2013/08/28 16:57:35
Should these be the following?
needs_*_device =
Henrik Grunell
2013/08/29 08:19:51
For request_.request_type == content::MEDIA_GENERA
|
// Get the exact audio or video device if an id is specified. |
- if (!request_.requested_audio_device_id.empty()) { |
+ if (needs_audio_device && !request_.requested_audio_device_id.empty()) { |
const content::MediaStreamDevice* audio_device = |
MediaCaptureDevicesDispatcher::GetInstance()-> |
GetRequestedAudioDevice(request_.requested_audio_device_id); |
@@ -223,7 +225,7 @@ void MediaStreamDevicesController::Accept(bool update_content_setting) { |
needs_audio_device = false; |
} |
} |
- if (!request_.requested_video_device_id.empty()) { |
+ if (needs_video_device && !request_.requested_video_device_id.empty()) { |
const content::MediaStreamDevice* video_device = |
tommi (sloooow) - chröme
2013/08/28 16:13:47
Wouldn't it make more sense to check the allowed b
Henrik Grunell
2013/08/29 08:19:51
Agree. Then I also renamed the needs_* bools to ge
|
MediaCaptureDevicesDispatcher::GetInstance()-> |
GetRequestedVideoDevice(request_.requested_video_device_id); |