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

Unified Diff: chrome/browser/webdata/autocomplete_syncable_service.cc

Issue 14018026: sync: SyncableService support for starting sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isherman's review Created 7 years, 8 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: chrome/browser/webdata/autocomplete_syncable_service.cc
diff --git a/chrome/browser/webdata/autocomplete_syncable_service.cc b/chrome/browser/webdata/autocomplete_syncable_service.cc
index f61d76a79a0941503dfdbcf45327c2107dee37bb..ed05a2b8519874baecb9daad95148b4122658345 100644
--- a/chrome/browser/webdata/autocomplete_syncable_service.cc
+++ b/chrome/browser/webdata/autocomplete_syncable_service.cc
@@ -127,6 +127,11 @@ AutocompleteSyncableService::AutocompleteSyncableService()
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
}
+void AutocompleteSyncableService::InjectStartSyncFlare(
+ const syncer::SyncableService::StartSyncFlare& flare) {
+ flare_ = flare;
+}
+
syncer::SyncMergeResult AutocompleteSyncableService::MergeDataAndStartSyncing(
syncer::ModelType type,
const syncer::SyncDataList& initial_sync_data,
@@ -304,12 +309,16 @@ syncer::SyncError AutocompleteSyncableService::ProcessSyncChanges(
void AutocompleteSyncableService::AutofillEntriesChanged(
const AutofillChangeList& changes) {
- // Check if sync is on. If we receive notification prior to the sync being set
- // up we are going to process all when MergeData..() is called. If we receive
- // notification after the sync exited, it will be sinced next time Chrome
- // starts.
- if (sync_processor_.get())
+ // Check if sync is on. If we recieve this notification prior to sync being
+ // started, we'll notify sync to start as soon as it can and later process
+ // all entries when MergeData..() is called. If we receive this notification
+ // sync has exited, it will be synced next time Chrome starts.
+ if (sync_processor_.get()) {
ActOnChanges(changes);
+ } else if (!flare_.is_null()) {
+ flare_.Run(syncer::AUTOFILL);
+ flare_.Reset();
+ }
}
bool AutocompleteSyncableService::LoadAutofillData(
« no previous file with comments | « chrome/browser/webdata/autocomplete_syncable_service.h ('k') | chrome/browser/webdata/web_data_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698