Chromium Code Reviews| 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 6e511e9dc0d0c331543a8992fcc80efb9db24812..967ec406c2579a5cefb5da2d3935856ede84d988 100644 |
| --- a/components/content_settings/core/browser/host_content_settings_map.cc |
| +++ b/components/content_settings/core/browser/host_content_settings_map.cc |
| @@ -8,6 +8,7 @@ |
| #include <utility> |
| +#include "base/bind.h" |
| #include "base/command_line.h" |
| #include "base/macros.h" |
| #include "base/memory/ptr_util.h" |
| @@ -139,15 +140,18 @@ content_settings::PatternPair GetPatternsFromScopingType( |
| } // namespace |
| -HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, |
| - bool is_incognito_profile, |
| - bool is_guest_profile) |
| +HostContentSettingsMap::HostContentSettingsMap( |
| + PrefService* prefs, |
| + bool is_incognito_profile, |
| + bool is_guest_profile, |
| + syncable_prefs::PrefServiceSyncable* pref_service) |
| : |
| #ifndef NDEBUG |
| used_from_thread_id_(base::PlatformThread::CurrentId()), |
| #endif |
| prefs_(prefs), |
| - is_off_the_record_(is_incognito_profile || is_guest_profile) { |
| + is_off_the_record_(is_incognito_profile || is_guest_profile), |
| + pref_service_(pref_service) { |
| DCHECK(!(is_incognito_profile && is_guest_profile)); |
| content_settings::PolicyProvider* policy_provider = |
| @@ -174,6 +178,12 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs, |
| MigrateKeygenSettings(); |
| RecordNumberOfExceptions(); |
| + |
| + if (pref_service_) { |
| + pref_service_->RegisterMergeDataFinishedCallback( |
| + base::Bind(&HostContentSettingsMap::MigrateDomainScopedSettings, |
| + base::Unretained(this))); |
|
raymes
2016/06/29 03:50:01
We should probably use a WeakPtr here instead of b
lshang
2016/06/30 05:03:36
Done.
|
| + } |
| } |
| // static |