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

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: Moved RequestType according to Shijing's proposal. 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 169f7db4dc37de4499e941bec2e82fc5021936f3..10178b357aa3c9ad4ebd097a7ec3d8efbaa7182a 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::OPEN_DEVICE) {
no longer working on chromium 2012/12/10 10:17:56 thanks, the code is much clearer now since we are
+ 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 =
@@ -138,7 +150,6 @@ bool MediaStreamDevicesController::DismissInfoBarAndTakeActionOnSettings() {
return true;
}
- // Show the infobar.
return false;
}

Powered by Google App Engine
This is Rietveld 408576698