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

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

Issue 965103004: Stop using the MEDIASTREAM content setting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase over 1004733003. Created 5 years, 9 months 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 cc371d52d592f293d56bd227a80b3e7f64914d6e..fb6f3816ab5ad6b3787be44e26ea15e40f1f11d7 100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -500,8 +500,12 @@ void MediaStreamDevicesController::RequestFinished() {
bool MediaStreamDevicesController::IsRequestAllowedByDefault() const {
// The request from internal objects like chrome://URLs is always allowed.
- if (CheckAllowAllMediaStreamContentForOrigin(profile_,
- request_.security_origin)) {
+ if (CheckAllowAllMediaStreamContentForOrigin(
+ profile_, request_.security_origin,
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
+ CheckAllowAllMediaStreamContentForOrigin(
+ profile_, request_.security_origin,
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA)) {
return true;
}
@@ -586,13 +590,12 @@ int MediaStreamDevicesController::FilterBlockedByDefaultDevices() {
bool MediaStreamDevicesController::IsDefaultMediaAccessBlocked() const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // TODO(markusheintz): Replace CONTENT_SETTINGS_TYPE_MEDIA_STREAM with the
- // appropriate new CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC and
- // CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA.
- ContentSetting current_setting =
- profile_->GetHostContentSettingsMap()->GetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_MEDIASTREAM, NULL);
- return (current_setting == CONTENT_SETTING_BLOCK);
+ return (profile_->GetHostContentSettingsMap()->GetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, NULL)
+ == CONTENT_SETTING_BLOCK &&
+ profile_->GetHostContentSettingsMap()->GetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, NULL)
+ == CONTENT_SETTING_BLOCK);
}
bool MediaStreamDevicesController::IsSchemeSecure() const {

Powered by Google App Engine
This is Rietveld 408576698