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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 1575623002: Disable Web Notifications in Incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permfix
Patch Set: Created 4 years, 11 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: components/content_settings/core/browser/host_content_settings_map.cc
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 fd9cbbf37d03f61f0e2e1c75163c2d63f0875b0d..0a44edba015482cb0b000a027538ec0968fbeb59 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -71,19 +71,20 @@ bool SchemeCanBeWhitelisted(const std::string& scheme) {
scheme == content_settings::kChromeUIScheme;
}
-// Prevents content settings marked INHERIT_IN_INCOGNITO_EXCEPT_ALLOW from
-// inheriting CONTENT_SETTING_ALLOW settings from regular to incognito.
+// Prevents content settings marked INHERIT_IN_INCOGNITO_EXCEPT_ALLOW or
+// DENY_IN_INCOGNITO_AFTER_DELAY from inheriting CONTENT_SETTING_ALLOW settings
+// from regular to incognito.
scoped_ptr<base::Value> CoerceSettingInheritedToIncognito(
ContentSettingsType content_type,
scoped_ptr<base::Value> value) {
const content_settings::ContentSettingsInfo* info =
content_settings::ContentSettingsRegistry::GetInstance()->Get(
content_type);
- if (!info)
- return value;
- if (info->incognito_behavior() !=
- content_settings::ContentSettingsInfo::INHERIT_IN_INCOGNITO_EXCEPT_ALLOW)
+ if (!info ||
+ info->incognito_behavior() ==
+ content_settings::ContentSettingsInfo::INHERIT_IN_INCOGNITO) {
return value;
+ }
ContentSetting setting = content_settings::ValueToContentSetting(value.get());
if (setting != CONTENT_SETTING_ALLOW)
return value;

Powered by Google App Engine
This is Rietveld 408576698