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

Side by Side Diff: components/syncable_prefs/pref_service_syncable.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, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/syncable_prefs/pref_service_syncable.h" 5 #include "components/syncable_prefs/pref_service_syncable.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer); 146 priority_pref_sync_associator_.AddSyncedPrefObserver(name, observer);
147 } 147 }
148 148
149 void PrefServiceSyncable::RemoveSyncedPrefObserver( 149 void PrefServiceSyncable::RemoveSyncedPrefObserver(
150 const std::string& name, 150 const std::string& name,
151 SyncedPrefObserver* observer) { 151 SyncedPrefObserver* observer) {
152 pref_sync_associator_.RemoveSyncedPrefObserver(name, observer); 152 pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
153 priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer); 153 priority_pref_sync_associator_.RemoveSyncedPrefObserver(name, observer);
154 } 154 }
155 155
156 void PrefServiceSyncable::RegisterMergeDataFinishedCallback(
157 const base::Closure& callback) {
158 pref_sync_associator_.RegisterMergeDataFinishedCallback(callback);
159 }
160
156 // Set the PrefModelAssociatorClient to use for that object during tests. 161 // Set the PrefModelAssociatorClient to use for that object during tests.
157 void PrefServiceSyncable::SetPrefModelAssociatorClientForTesting( 162 void PrefServiceSyncable::SetPrefModelAssociatorClientForTesting(
158 const PrefModelAssociatorClient* pref_model_associator_client) { 163 const PrefModelAssociatorClient* pref_model_associator_client) {
159 pref_sync_associator_.SetPrefModelAssociatorClientForTesting( 164 pref_sync_associator_.SetPrefModelAssociatorClientForTesting(
160 pref_model_associator_client); 165 pref_model_associator_client);
161 priority_pref_sync_associator_.SetPrefModelAssociatorClientForTesting( 166 priority_pref_sync_associator_.SetPrefModelAssociatorClientForTesting(
162 pref_model_associator_client); 167 pref_model_associator_client);
163 } 168 }
164 169
165 void PrefServiceSyncable::AddRegisteredSyncablePreference( 170 void PrefServiceSyncable::AddRegisteredSyncablePreference(
(...skipping 11 matching lines...) Expand all
177 FOR_EACH_OBSERVER(PrefServiceSyncableObserver, observer_list_, 182 FOR_EACH_OBSERVER(PrefServiceSyncableObserver, observer_list_,
178 OnIsSyncingChanged()); 183 OnIsSyncingChanged());
179 } 184 }
180 185
181 void PrefServiceSyncable::ProcessPrefChange(const std::string& name) { 186 void PrefServiceSyncable::ProcessPrefChange(const std::string& name) {
182 pref_sync_associator_.ProcessPrefChange(name); 187 pref_sync_associator_.ProcessPrefChange(name);
183 priority_pref_sync_associator_.ProcessPrefChange(name); 188 priority_pref_sync_associator_.ProcessPrefChange(name);
184 } 189 }
185 190
186 } // namespace syncable_prefs 191 } // namespace syncable_prefs
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698