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

Unified Diff: components/autofill/core/browser/webdata/autofill_webdata_service.cc

Issue 2142123002: [Autofill] Run autofill-profile de-dupe after sync starts if sync is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Perform at most a single merge for new incoming sync data 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/webdata/autofill_webdata_service.cc
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_service.cc b/components/autofill/core/browser/webdata/autofill_webdata_service.cc
index 377ce32e2d4b6ea81dd473b414baac27be55c9a6..0d299725895d06f2e2c1e96ec90c1cef728cf988 100644
--- a/components/autofill/core/browser/webdata/autofill_webdata_service.cc
+++ b/components/autofill/core/browser/webdata/autofill_webdata_service.cc
@@ -39,9 +39,12 @@ AutofillWebDataService::AutofillWebDataService(
base::Closure on_changed_callback = Bind(
&AutofillWebDataService::NotifyAutofillMultipleChangedOnUIThread,
weak_ptr_factory_.GetWeakPtr());
-
+ base::Callback<void(syncer::ModelType)> on_sync_started_callback = Bind(
+ &AutofillWebDataService::NotifySyncStartedOnUIThread,
+ weak_ptr_factory_.GetWeakPtr());
autofill_backend_ = new AutofillWebDataBackendImpl(
- wdbs_->GetBackend(), ui_thread_, db_thread_, on_changed_callback);
+ wdbs_->GetBackend(), ui_thread_, db_thread_, on_changed_callback,
+ on_sync_started_callback);
}
AutofillWebDataService::AutofillWebDataService(
@@ -52,12 +55,13 @@ AutofillWebDataService::AutofillWebDataService(
ui_thread),
ui_thread_(ui_thread),
db_thread_(db_thread),
- autofill_backend_(new AutofillWebDataBackendImpl(NULL,
- ui_thread_,
- db_thread_,
- base::Closure())),
- weak_ptr_factory_(this) {
-}
+ autofill_backend_(new AutofillWebDataBackendImpl(
+ NULL,
Mathieu 2016/07/18 14:53:20 nit: nullptr
Roger McFarlane (Chromium) 2016/07/18 15:29:18 Done.
+ ui_thread_,
+ db_thread_,
+ base::Closure(),
+ base::Callback<void(syncer::ModelType)>())),
+ weak_ptr_factory_(this) {}
void AutofillWebDataService::ShutdownOnUIThread() {
weak_ptr_factory_.InvalidateWeakPtrs();
@@ -296,4 +300,12 @@ void AutofillWebDataService::NotifyAutofillMultipleChangedOnUIThread() {
AutofillMultipleChanged());
}
+void AutofillWebDataService::NotifySyncStartedOnUIThread(
+ syncer::ModelType model_type) {
+ DCHECK(ui_thread_->BelongsToCurrentThread());
+ FOR_EACH_OBSERVER(AutofillWebDataServiceObserverOnUIThread,
+ ui_observer_list_,
+ SyncStarted(model_type));
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698