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

Unified Diff: chrome/browser/host_content_settings_map.cc

Issue 5355005: Don't reset BlockThirdPartyCookies to it's default value if the preference it managed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 10 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
« no previous file with comments | « no previous file | chrome/browser/host_content_settings_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/host_content_settings_map.cc
diff --git a/chrome/browser/host_content_settings_map.cc b/chrome/browser/host_content_settings_map.cc
index dc6517cf9d39228765fa2922187924b9fb122c9e..6aac686b3897bdf34c7e7c2d9e50a93cd4d920e3 100644
--- a/chrome/browser/host_content_settings_map.cc
+++ b/chrome/browser/host_content_settings_map.cc
@@ -796,9 +796,13 @@ void HostContentSettingsMap::ResetToDefaults() {
AutoLock auto_lock(lock_);
default_content_settings_ = ContentSettings();
ForceDefaultsToBeExplicit();
+ // Clear all content settings map except the
+ // managed_default_content_settings.
host_content_settings_.clear();
off_the_record_settings_.clear();
- block_third_party_cookies_ = false;
+ // Don't reset block third party cookies if they are managed.
+ if (!IsBlockThirdPartyCookiesManaged())
+ block_third_party_cookies_ = false;
block_nonsandboxed_plugins_ = false;
}
@@ -807,6 +811,9 @@ void HostContentSettingsMap::ResetToDefaults() {
updating_preferences_ = true;
prefs->ClearPref(prefs::kDefaultContentSettings);
prefs->ClearPref(prefs::kContentSettingsPatterns);
+ // If the block third party cookies preference is managed we still must
+ // clear it in order to restore the default value for later when the
+ // preference is not managed anymore.
prefs->ClearPref(prefs::kBlockThirdPartyCookies);
prefs->ClearPref(prefs::kBlockNonsandboxedPlugins);
updating_preferences_ = false;
« no previous file with comments | « no previous file | chrome/browser/host_content_settings_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698