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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 2078893002: Add callback list to PrefModelAssociator after sync data is loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_domain_scoped_settings
Patch Set: Created 4 years, 6 months 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/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

Powered by Google App Engine
This is Rietveld 408576698