| Index: chrome/browser/media/media_capture_devices_dispatcher.cc
|
| diff --git a/chrome/browser/media/media_capture_devices_dispatcher.cc b/chrome/browser/media/media_capture_devices_dispatcher.cc
|
| index 10a67807eba00ece75edcecf586a63ab31af1a66..6690dbdff7d9b387ea0e48f4c6830597e9918ba3 100644
|
| --- a/chrome/browser/media/media_capture_devices_dispatcher.cc
|
| +++ b/chrome/browser/media/media_capture_devices_dispatcher.cc
|
| @@ -300,7 +300,7 @@ void MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest(
|
| scoped_ptr<content::MediaStreamUI> ui;
|
|
|
| if (request.video_type != content::MEDIA_DESKTOP_VIDEO_CAPTURE) {
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(devices, content::INVALID_STATE, ui.Pass());
|
| return;
|
| }
|
|
|
| @@ -320,7 +320,7 @@ void MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest(
|
|
|
| // Received invalid device id.
|
| if (media_id.type == content::DesktopMediaID::TYPE_NONE) {
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(devices, content::INVALID_STATE, ui.Pass());
|
| return;
|
| }
|
|
|
| @@ -340,7 +340,7 @@ void MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest(
|
| devices, media_id, capture_audio, true,
|
| GetApplicationTitle(web_contents, extension));
|
|
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(devices, content::OK, ui.Pass());
|
| }
|
|
|
| void MediaCaptureDevicesDispatcher::ProcessScreenCaptureAccessRequest(
|
| @@ -429,7 +429,10 @@ void MediaCaptureDevicesDispatcher::ProcessScreenCaptureAccessRequest(
|
| }
|
| }
|
|
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(
|
| + devices,
|
| + devices.empty() ? content::INVALID_STATE: content::OK,
|
| + ui.Pass());
|
| }
|
|
|
| void MediaCaptureDevicesDispatcher::ProcessTabCaptureAccessRequest(
|
| @@ -450,7 +453,7 @@ void MediaCaptureDevicesDispatcher::ProcessTabCaptureAccessRequest(
|
| extensions::TabCaptureRegistry::Get(profile);
|
| if (!tab_capture_registry) {
|
| NOTREACHED();
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(devices, content::INVALID_STATE, ui.Pass());
|
| return;
|
| }
|
| bool tab_capture_allowed =
|
| @@ -475,7 +478,10 @@ void MediaCaptureDevicesDispatcher::ProcessTabCaptureAccessRequest(
|
| ui = media_stream_capture_indicator_->RegisterMediaStream(
|
| web_contents, devices);
|
| }
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(
|
| + devices,
|
| + devices.empty() ? content::INVALID_STATE: content::OK,
|
| + ui.Pass());
|
| #endif // !defined(OS_ANDROID)
|
| }
|
|
|
| @@ -504,7 +510,10 @@ void MediaCaptureDevicesDispatcher::
|
| ui = media_stream_capture_indicator_->RegisterMediaStream(
|
| web_contents, devices);
|
| }
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(
|
| + devices,
|
| + devices.empty() ? content::INVALID_STATE: content::OK,
|
| + ui.Pass());
|
| }
|
|
|
| void MediaCaptureDevicesDispatcher::ProcessRegularMediaAccessRequest(
|
| @@ -559,6 +568,7 @@ void MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest(
|
| void MediaCaptureDevicesDispatcher::OnAccessRequestResponse(
|
| content::WebContents* web_contents,
|
| const content::MediaStreamDevices& devices,
|
| + content::MediaStreamRequestResult result,
|
| scoped_ptr<content::MediaStreamUI> ui) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| @@ -586,7 +596,7 @@ void MediaCaptureDevicesDispatcher::OnAccessRequestResponse(
|
| base::Unretained(this), web_contents));
|
| }
|
|
|
| - callback.Run(devices, ui.Pass());
|
| + callback.Run(devices, result, ui.Pass());
|
| }
|
|
|
| void MediaCaptureDevicesDispatcher::GetDefaultDevicesForProfile(
|
|
|