diff options
author | msramek <msramek@chromium.org> | 2015-04-10 04:36:17 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-10 11:36:43 +0000 |
commit | 1c9c14cb78ddf3da2ded5a2f06447b0da75375b8 (patch) | |
tree | 9d2c7d6e3e3f8690c7ab8af27544eeabb9556e6f /components/content_settings | |
parent | aaa8c41c3f424907b3ba0f2dc2f757bfc0da448d (diff) | |
download | chromium_src-1c9c14cb78ddf3da2ded5a2f06447b0da75375b8.zip chromium_src-1c9c14cb78ddf3da2ded5a2f06447b0da75375b8.tar.gz chromium_src-1c9c14cb78ddf3da2ded5a2f06447b0da75375b8.tar.bz2 |
Initialize incognito content settings on startup.
The standard (non-incognito) value map of an incognito ContentSettingsPref instance was not initialized. It should be initialized with the contents of the preference.
The effect was that the incognito session only acknowledged settings that were set after it started.
BUG=474462
Review URL: https://codereview.chromium.org/1077693002
Cr-Commit-Position: refs/heads/master@{#324615}
Diffstat (limited to 'components/content_settings')
-rw-r--r-- | components/content_settings/core/browser/content_settings_pref.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/content_settings/core/browser/content_settings_pref.cc b/components/content_settings/core/browser/content_settings_pref.cc index 7cfd31a..e18fa28 100644 --- a/components/content_settings/core/browser/content_settings_pref.cc +++ b/components/content_settings/core/browser/content_settings_pref.cc @@ -70,9 +70,12 @@ ContentSettingsPref::ContentSettingsPref( // of the old preference to this new preference. There is no need // to initialize this preference separately (in fact, in the case // of migration, we would be writing the empty new preference back to the - // old one, erasing it). - if (prefs_->GetBoolean(prefs::kMigratedContentSettingsPatternPairs) && - !IsContentSettingsTypeSyncable(content_type_)) { + // old one, erasing it). Since copying between preferences is disallowed + // in incognito, |ContentSettingsPref| needs to be initialized from the new + // preference in incognito as well. + if ((prefs_->GetBoolean(prefs::kMigratedContentSettingsPatternPairs) && + !IsContentSettingsTypeSyncable(content_type_)) + || is_incognito_) { ReadContentSettingsFromPrefAndWriteToOldPref(); } |