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

Unified Diff: components/content_settings/core/browser/content_settings_pref.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: 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/content_settings_pref.cc
diff --git a/components/content_settings/core/browser/content_settings_pref.cc b/components/content_settings/core/browser/content_settings_pref.cc
index c79c9733d87126e7a457d5a713872af1be04b00d..f3e22e66fa5424daee734db8d05570e60c5d3ca4 100644
--- a/components/content_settings/core/browser/content_settings_pref.cc
+++ b/components/content_settings/core/browser/content_settings_pref.cc
@@ -244,6 +244,12 @@ bool ContentSettingsPref::TryLockForTesting() const {
}
void ContentSettingsPref::ReadContentSettingsFromPref() {
+ // Unlike other permissions, the Notifications and Push Messaging permissions
+ // aren't inherited from regular to incognito. Their value_map_ is left empty.
msramek 2015/11/16 12:40:45 Even if we currently don't have plans to do this f
Peter Beverloo 2015/11/16 17:14:32 +1, although I think we may as well do it as part
raymes 2015/11/17 00:16:00 Oops, sorry I missed this CL. Yes, it would be bet
msramek 2015/11/17 10:37:55 Just FYI, if you need to need to merge it or have
johnme 2015/11/26 17:31:54 Done - I added WebsiteSettingsInfo::IncognitoBehav
raymes 2015/11/30 00:28:46 I think it would be better to either patch the def
johnme 2015/11/30 14:56:58 I've moved the new logic to a helper function in H
+ if (is_incognito_ && (content_type_ == CONTENT_SETTINGS_TYPE_NOTIFICATIONS ||
+ content_type_ == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING))
+ return;
+
// |DictionaryPrefUpdate| sends out notifications when destructed. This
// construction order ensures |AutoLock| gets destroyed first and |lock_| is
// not held when the notifications are sent. Also, |auto_reset| must be still

Powered by Google App Engine
This is Rietveld 408576698