summaryrefslogtreecommitdiffstats
path: root/components/content_settings
diff options
context:
space:
mode:
Diffstat (limited to 'components/content_settings')
-rw-r--r--components/content_settings/core/browser/content_settings_pref.cc9
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();
}