Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1828)

Unified Diff: chrome/browser/media/media_stream_devices_controller.cc

Issue 11446042: Make sure that all OpenDevice requests are scrutinized against the audio and video policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 793254723bf621dab999885ccfe95006933fd484..ba61d5dddf1555770a294d5c401c672f815b262c 100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -80,6 +80,18 @@ void MediaStreamDevicesController::RegisterUserPrefs(PrefService* prefs) {
bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() {
+ // If this is a no UI check for policies only go straight to accept - policy
+ // check will be done automatically on the way.
+ if (request_.request_type == content::MEDIA_OPEN_DEVICE) {
+ std::string audio, video;
+ if (has_audio_)
+ audio = GetFirstDeviceId(content::MEDIA_DEVICE_AUDIO_CAPTURE);
+ if (has_video_)
+ video = GetFirstDeviceId(content::MEDIA_DEVICE_VIDEO_CAPTURE);
+ Accept(audio, video, false);
+ return true;
+ }
+
// For tab media requests, we need to make sure the request came from the
// extension API, so we check the registry here.
content::MediaStreamDeviceMap::const_iterator tab_video =
@@ -141,7 +153,6 @@ bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() {
return true;
}
- // Show the infobar.
return false;
}

Powered by Google App Engine
This is Rietveld 408576698