From b34177cd95a419c5cd72720ff0e00bf953f24b79 Mon Sep 17 00:00:00 2001 From: msramek Date: Thu, 23 Apr 2015 02:48:03 -0700 Subject: Disable the ALLOW value for camera and mic content settings. We used to use MEDIASTREAM content setting for media default ( ASK / BLOCK ) CAMERA / MIC content settings for media exceptions ( ALLOW / ASK / BLOCK ) When we stopped using MEDIASTREAM and replaced it with CAMERA / MIC for defaults as well, we didn't ensure that the ALLOW value is still unsupported as default. This CL fixes that. Although during the short period when the default settings supported ALLOW values we had no UI to set it, we include a migration code just to be on the safe side. BUG=464382 Review URL: https://codereview.chromium.org/1092743005 Cr-Commit-Position: refs/heads/master@{#326486} --- .../content_settings/core/browser/host_content_settings_map.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'components/content_settings') diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc index 74076c5..39f70ee 100644 --- a/components/content_settings/core/browser/host_content_settings_map.cc +++ b/components/content_settings/core/browser/host_content_settings_map.cc @@ -493,6 +493,14 @@ bool HostContentSettingsMap::IsDefaultSettingAllowedForType( return false; } #endif + + // Don't support ALLOW for the default media settings. + if ((content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA || + content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) && + setting == CONTENT_SETTING_ALLOW) { + return false; + } + return IsSettingAllowedForType(prefs, setting, content_type); } -- cgit v1.1