summaryrefslogtreecommitdiffstats
path: root/components/content_settings
diff options
context:
space:
mode:
authormsramek <msramek@chromium.org>2015-04-23 02:48:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-23 09:48:14 +0000
commitb34177cd95a419c5cd72720ff0e00bf953f24b79 (patch)
tree06cf0b262054f368c11913ef68e7b14f4641b4dd /components/content_settings
parent8b88ed7364127c74fb55ca8a7787dcee523970c8 (diff)
downloadchromium_src-b34177cd95a419c5cd72720ff0e00bf953f24b79.zip
chromium_src-b34177cd95a419c5cd72720ff0e00bf953f24b79.tar.gz
chromium_src-b34177cd95a419c5cd72720ff0e00bf953f24b79.tar.bz2
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}
Diffstat (limited to 'components/content_settings')
-rw-r--r--components/content_settings/core/browser/host_content_settings_map.cc8
1 files changed, 8 insertions, 0 deletions
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);
}