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

Unified Diff: components/webdata_services/web_data_service_wrapper.cc

Issue 2508263003: [sync] skeleton implementation of AutocompleteSyncBridge (Closed)
Patch Set: Max's comments; merged chrome_sync_client Created 4 years, 1 month 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
« no previous file with comments | « components/sync/driver/sync_driver_switches.cc ('k') | ios/chrome/browser/sync/ios_chrome_sync_client.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webdata_services/web_data_service_wrapper.cc
diff --git a/components/webdata_services/web_data_service_wrapper.cc b/components/webdata_services/web_data_service_wrapper.cc
index 1b9b41ab263ca04b4cbb546c154a6c510135fdc2..a8ff689fe4836b1adf07310d24d89418b6f93ea7 100644
--- a/components/webdata_services/web_data_service_wrapper.cc
+++ b/components/webdata_services/web_data_service_wrapper.cc
@@ -6,10 +6,12 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
+#include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h"
#include "components/autofill/core/browser/webdata/autocomplete_syncable_service.h"
#include "components/autofill/core/browser/webdata/autofill_profile_syncable_service.h"
#include "components/autofill/core/browser/webdata/autofill_table.h"
@@ -21,6 +23,7 @@
#include "components/search_engines/keyword_web_data_service.h"
#include "components/signin/core/browser/webdata/token_service_table.h"
#include "components/signin/core/browser/webdata/token_web_data.h"
+#include "components/sync/driver/sync_driver_switches.h"
#include "components/webdata/common/web_database_service.h"
#include "components/webdata/common/webdata_constants.h"
@@ -41,10 +44,16 @@ void InitSyncableServicesOnDBThread(
// Currently only Autocomplete and Autofill profiles use the new Sync API, but
// all the database data should migrate to this API over time.
- autofill::AutocompleteSyncableService::CreateForWebDataServiceAndBackend(
- autofill_web_data.get(), autofill_backend);
- autofill::AutocompleteSyncableService::FromWebDataService(
- autofill_web_data.get())->InjectStartSyncFlare(sync_flare);
+ if (base::FeatureList::IsEnabled(switches::kSyncUSSAutocomplete)) {
+ autofill::AutocompleteSyncBridge::CreateForWebDataServiceAndBackend(
+ autofill_web_data.get(), autofill_backend);
+ } else {
+ autofill::AutocompleteSyncableService::CreateForWebDataServiceAndBackend(
+ autofill_web_data.get(), autofill_backend);
+ autofill::AutocompleteSyncableService::FromWebDataService(
+ autofill_web_data.get())
+ ->InjectStartSyncFlare(sync_flare);
+ }
autofill::AutofillProfileSyncableService::CreateForWebDataServiceAndBackend(
autofill_web_data.get(), autofill_backend, app_locale);
« no previous file with comments | « components/sync/driver/sync_driver_switches.cc ('k') | ios/chrome/browser/sync/ios_chrome_sync_client.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698