| Index: components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
|
| diff --git a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
|
| index 2ebc31be5df38f15b723c14de7c88a98c10c6e58..1bc55bbda26e4d0c8a7129b59e3e1800eb69d769 100644
|
| --- a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
|
| +++ b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
|
| @@ -29,13 +29,15 @@ AutofillWebDataBackendImpl::AutofillWebDataBackendImpl(
|
| scoped_refptr<WebDatabaseBackend> web_database_backend,
|
| scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
|
| scoped_refptr<base::SingleThreadTaskRunner> db_thread,
|
| - const base::Closure& on_changed_callback)
|
| + const base::Closure& on_changed_callback,
|
| + const base::Callback<void(syncer::ModelType)>& on_sync_started_callback)
|
| : base::RefCountedDeleteOnMessageLoop<AutofillWebDataBackendImpl>(
|
| db_thread),
|
| ui_thread_(ui_thread),
|
| db_thread_(db_thread),
|
| web_database_backend_(web_database_backend),
|
| - on_changed_callback_(on_changed_callback) {
|
| + on_changed_callback_(on_changed_callback),
|
| + on_sync_started_callback_(on_sync_started_callback) {
|
| }
|
|
|
| void AutofillWebDataBackendImpl::AddObserver(
|
| @@ -76,6 +78,18 @@ void AutofillWebDataBackendImpl::NotifyOfMultipleAutofillChanges() {
|
| ui_thread_->PostTask(FROM_HERE, on_changed_callback_);
|
| }
|
|
|
| +void AutofillWebDataBackendImpl::NotifyThatSyncHasStarted(
|
| + syncer::ModelType model_type) {
|
| + DCHECK(db_thread_->BelongsToCurrentThread());
|
| +
|
| + if (on_sync_started_callback_.is_null())
|
| + return;
|
| +
|
| + // UI thread notification.
|
| + ui_thread_->PostTask(FROM_HERE,
|
| + base::Bind(on_sync_started_callback_, model_type));
|
| +}
|
| +
|
| base::SupportsUserData* AutofillWebDataBackendImpl::GetDBUserData() {
|
| DCHECK(db_thread_->BelongsToCurrentThread());
|
| if (!user_data_)
|
|
|