OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/browser_sync/profile_sync_components_factory_impl.h" | 5 #include "components/browser_sync/profile_sync_components_factory_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "components/autofill/core/browser/autofill_wallet_data_type_controller.
h" | 13 #include "components/autofill/core/browser/autofill_wallet_data_type_controller.
h" |
| 14 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h" |
14 #include "components/autofill/core/browser/webdata/autofill_data_type_controller
.h" | 15 #include "components/autofill/core/browser/webdata/autofill_data_type_controller
.h" |
15 #include "components/autofill/core/browser/webdata/autofill_profile_data_type_co
ntroller.h" | 16 #include "components/autofill/core/browser/webdata/autofill_profile_data_type_co
ntroller.h" |
16 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 17 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 18 #include "components/autofill/core/browser/webdata/web_data_model_type_controlle
r.h" |
17 #include "components/autofill/core/common/autofill_pref_names.h" | 19 #include "components/autofill/core/common/autofill_pref_names.h" |
18 #include "components/autofill/core/common/autofill_switches.h" | 20 #include "components/autofill/core/common/autofill_switches.h" |
19 #include "components/browser_sync/browser_sync_switches.h" | 21 #include "components/browser_sync/browser_sync_switches.h" |
20 #include "components/browser_sync/profile_sync_service.h" | 22 #include "components/browser_sync/profile_sync_service.h" |
21 #include "components/dom_distiller/core/dom_distiller_features.h" | 23 #include "components/dom_distiller/core/dom_distiller_features.h" |
22 #include "components/history/core/browser/history_delete_directives_data_type_co
ntroller.h" | 24 #include "components/history/core/browser/history_delete_directives_data_type_co
ntroller.h" |
23 #include "components/history/core/browser/typed_url_data_type_controller.h" | 25 #include "components/history/core/browser/typed_url_data_type_controller.h" |
24 #include "components/password_manager/core/browser/password_store.h" | 26 #include "components/password_manager/core/browser/password_store.h" |
25 #include "components/password_manager/sync/browser/password_data_type_controller
.h" | 27 #include "components/password_manager/sync/browser/password_data_type_controller
.h" |
26 #include "components/prefs/pref_service.h" | 28 #include "components/prefs/pref_service.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 base::MakeUnique<DeviceInfoDataTypeController>( | 150 base::MakeUnique<DeviceInfoDataTypeController>( |
149 error_callback, sync_client_, | 151 error_callback, sync_client_, |
150 sync_service->GetLocalDeviceInfoProvider())); | 152 sync_service->GetLocalDeviceInfoProvider())); |
151 } | 153 } |
152 | 154 |
153 // Autocomplete sync is enabled by default. Register unless explicitly | 155 // Autocomplete sync is enabled by default. Register unless explicitly |
154 // disabled. | 156 // disabled. |
155 if (!disabled_types.Has(syncer::AUTOFILL)) { | 157 if (!disabled_types.Has(syncer::AUTOFILL)) { |
156 if (base::FeatureList::IsEnabled(switches::kSyncUSSAutocomplete)) { | 158 if (base::FeatureList::IsEnabled(switches::kSyncUSSAutocomplete)) { |
157 sync_service->RegisterDataTypeController( | 159 sync_service->RegisterDataTypeController( |
158 base::MakeUnique<ModelTypeController>(syncer::AUTOFILL, sync_client_, | 160 base::MakeUnique<autofill::WebDataModelTypeController>( |
159 db_thread_)); | 161 syncer::AUTOFILL, sync_client_, db_thread_, web_data_service_, |
| 162 base::Bind( |
| 163 &autofill::AutocompleteSyncBridge::FromWebDataService))); |
160 } else { | 164 } else { |
161 sync_service->RegisterDataTypeController( | 165 sync_service->RegisterDataTypeController( |
162 base::MakeUnique<AutofillDataTypeController>( | 166 base::MakeUnique<AutofillDataTypeController>( |
163 db_thread_, error_callback, sync_client_, web_data_service_)); | 167 db_thread_, error_callback, sync_client_, web_data_service_)); |
164 } | 168 } |
165 } | 169 } |
166 | 170 |
167 // Autofill sync is enabled by default. Register unless explicitly | 171 // Autofill sync is enabled by default. Register unless explicitly |
168 // disabled. | 172 // disabled. |
169 if (!disabled_types.Has(syncer::AUTOFILL_PROFILE)) { | 173 if (!disabled_types.Has(syncer::AUTOFILL_PROFILE)) { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 440 |
437 // static | 441 // static |
438 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { | 442 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { |
439 override_prefs_controller_to_uss_for_test_ = use_uss; | 443 override_prefs_controller_to_uss_for_test_ = use_uss; |
440 } | 444 } |
441 | 445 |
442 bool ProfileSyncComponentsFactoryImpl:: | 446 bool ProfileSyncComponentsFactoryImpl:: |
443 override_prefs_controller_to_uss_for_test_ = false; | 447 override_prefs_controller_to_uss_for_test_ = false; |
444 | 448 |
445 } // namespace browser_sync | 449 } // namespace browser_sync |
OLD | NEW |