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

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

Issue 1442083002: Stop inheriting push notification permissions from regular to incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Annotate bool parameters Created 5 years, 1 month 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 660cefa0b2c6310f44c59b35c7f44c2062cf5fbe..c1d84aba99ec1d453a8cfec3d7d110ecf68ee732 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -23,6 +23,8 @@
#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/browser/content_settings_rule.h"
#include "components/content_settings/core/browser/content_settings_utils.h"
+#include "components/content_settings/core/browser/website_settings_info.h"
+#include "components/content_settings/core/browser/website_settings_registry.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
@@ -156,6 +158,13 @@ ContentSetting HostContentSettingsMap::GetDefaultContentSetting(
continue;
ContentSetting default_setting =
GetDefaultContentSettingFromProvider(content_type, provider->second);
+ if (is_off_the_record_ && default_setting == CONTENT_SETTING_ALLOW) {
+ if (content_settings::WebsiteSettingsRegistry::GetInstance()
Michael van Ouwerkerk 2015/11/26 18:51:06 As this is a wrapped condition, it should have cur
johnme 2015/11/27 14:12:28 Removed this, but done elsewhere.
+ ->Get(content_type)->incognito_behavior()
+ == content_settings::WebsiteSettingsInfo
+ ::INHERIT_IN_INCOGNITO_EXCEPT_ALLOW)
Michael van Ouwerkerk 2015/11/26 18:51:06 This whole section is a bit hard to read because o
johnme 2015/11/27 14:12:29 I tidied this up.
+ default_setting = CONTENT_SETTING_ASK;
+ }
if (default_setting != CONTENT_SETTING_DEFAULT) {
if (provider_id)
*provider_id = kProviderNamesSourceMap[provider->first].provider_name;
@@ -619,7 +628,7 @@ scoped_ptr<base::Value> HostContentSettingsMap::GetWebsiteSettingInternal(
provider != content_settings_providers_.end();
++provider) {
- scoped_ptr<base::Value> value(
+ scoped_ptr<base::Value> value =
content_settings::GetContentSettingValueAndPatterns(provider->second,
primary_url,
secondary_url,
@@ -627,7 +636,7 @@ scoped_ptr<base::Value> HostContentSettingsMap::GetWebsiteSettingInternal(
resource_identifier,
is_off_the_record_,
primary_pattern,
- secondary_pattern));
+ secondary_pattern);
if (value) {
if (info)
info->source = kProviderNamesSourceMap[provider->first].provider_source;

Powered by Google App Engine
This is Rietveld 408576698