Chromium Code Reviews| 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 f0e3a3f4a82ffd2e4e5bf4e58f45f3ffd5927b0c..f362d669a827ec8f992b738445fde166462e4a91 100644 |
| --- a/chrome/browser/media/media_stream_devices_controller.cc |
| +++ b/chrome/browser/media/media_stream_devices_controller.cc |
| @@ -4,6 +4,7 @@ |
| #include "chrome/browser/media/media_stream_devices_controller.h" |
| +#include "base/stringprintf.h" |
| #include "base/values.h" |
| #include "chrome/browser/content_settings/content_settings_provider.h" |
| #include "chrome/browser/content_settings/host_content_settings_map.h" |
| @@ -56,7 +57,30 @@ MediaStreamDevicesController::~MediaStreamDevicesController() {} |
| bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() { |
| if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || |
| request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { |
| - Accept(false); |
| + extensions::TabCaptureRegistry* registry = |
| + extensions::TabCaptureRegistryFactory::GetForProfile(profile_); |
| + |
| + std::string device_id = base::StringPrintf( |
| + "%i:%i", request_.render_process_id, request_.render_view_id); |
|
no longer working on chromium
2012/12/05 17:38:37
this code looks a bit odd, can you consider change
|
| + |
| + if (!registry->VerifyRequest(device_id)) { |
| + Deny(); |
| + } else { |
| + content::MediaStreamDevices devices; |
| + |
| + if (request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { |
| + devices.push_back(content::MediaStreamDevice( |
| + content::MEDIA_TAB_VIDEO_CAPTURE, "", "")); |
| + } |
| + if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE) { |
| + devices.push_back(content::MediaStreamDevice( |
| + content::MEDIA_TAB_AUDIO_CAPTURE, "", "")); |
| + } |
| + |
| + callback_.Run(devices); |
| + } |
| + |
| + return true; |
| } |
| // Deny the request if the security origin is empty, this happens with |