| Index: components/syncable_prefs/pref_model_associator.cc
|
| diff --git a/components/syncable_prefs/pref_model_associator.cc b/components/syncable_prefs/pref_model_associator.cc
|
| index 4cbdd558881022f6e5abb32c4cd5e53da6e8baf8..9e3d4722324050e6dbad476d3da12b1662e39acf 100644
|
| --- a/components/syncable_prefs/pref_model_associator.cc
|
| +++ b/components/syncable_prefs/pref_model_associator.cc
|
| @@ -7,6 +7,8 @@
|
| #include <utility>
|
|
|
| #include "base/auto_reset.h"
|
| +#include "base/bind.h"
|
| +#include "base/callback.h"
|
| #include "base/json/json_reader.h"
|
| #include "base/json/json_string_value_serializer.h"
|
| #include "base/location.h"
|
| @@ -54,6 +56,8 @@ sync_pb::PreferenceSpecifics* GetMutableSpecifics(
|
|
|
| } // namespace
|
|
|
| +base::Closure syncable_prefs::PrefModelAssociator::migrate_call_back_;
|
| +
|
| PrefModelAssociator::PrefModelAssociator(
|
| const PrefModelAssociatorClient* client,
|
| syncer::ModelType type)
|
| @@ -157,6 +161,17 @@ void PrefModelAssociator::InitPrefAndAssociate(
|
| // we'll send the new user controlled value to the syncer.
|
| }
|
|
|
| +// static
|
| +void PrefModelAssociator::SetMergeDataFinishedCallback(
|
| + const base::Closure& callback) {
|
| + migrate_call_back_ = callback;
|
| +}
|
| +
|
| +// static
|
| +void PrefModelAssociator::ResetMergeDataFinishedCallback() {
|
| + migrate_call_back_.Reset();
|
| +}
|
| +
|
| syncer::SyncMergeResult PrefModelAssociator::MergeDataAndStartSyncing(
|
| syncer::ModelType type,
|
| const syncer::SyncDataList& initial_sync_data,
|
| @@ -206,7 +221,9 @@ syncer::SyncMergeResult PrefModelAssociator::MergeDataAndStartSyncing(
|
| ++pref_name_iter) {
|
| InitPrefAndAssociate(syncer::SyncData(), *pref_name_iter, &new_changes);
|
| }
|
| -
|
| + if (!migrate_call_back_.is_null()) {
|
| + migrate_call_back_.Run();
|
| + }
|
| // Push updates to sync.
|
| merge_result.set_error(
|
| sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes));
|
|
|