Chromium Code Reviews| 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 "chrome/browser/sync/profile_sync_components_factory_impl.h" | 5 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" | 12 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
| 13 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" | 13 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" |
| 14 #include "chrome/browser/sync/glue/autofill_wallet_data_type_controller.h" | |
| 15 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 14 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
| 16 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" | 15 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
| 17 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 16 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
| 18 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" | 17 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" |
| 19 #include "chrome/browser/sync/glue/history_delete_directives_data_type_controlle r.h" | 18 #include "chrome/browser/sync/glue/history_delete_directives_data_type_controlle r.h" |
| 20 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" | 19 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" |
| 21 #include "chrome/browser/sync/glue/password_data_type_controller.h" | 20 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
| 22 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h" | 21 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h" |
| 23 #include "chrome/browser/sync/glue/sync_backend_host.h" | 22 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 24 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" | 23 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 25 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 24 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
| 26 #include "chrome/browser/sync/glue/typed_url_change_processor.h" | 25 #include "chrome/browser/sync/glue/typed_url_change_processor.h" |
| 27 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 26 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
| 28 #include "chrome/browser/sync/profile_sync_service.h" | 27 #include "chrome/browser/sync/profile_sync_service.h" |
| 29 #include "chrome/browser/sync/sessions/session_data_type_controller.h" | 28 #include "chrome/browser/sync/sessions/session_data_type_controller.h" |
| 30 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
| 31 #include "components/autofill/core/browser/autofill_wallet_data_type_controller. h" | |
| 32 #include "components/autofill/core/common/autofill_pref_names.h" | 32 #include "components/autofill/core/common/autofill_pref_names.h" |
| 33 #include "components/autofill/core/common/autofill_switches.h" | 33 #include "components/autofill/core/common/autofill_switches.h" |
| 34 #include "components/dom_distiller/core/dom_distiller_features.h" | 34 #include "components/dom_distiller/core/dom_distiller_features.h" |
| 35 #include "components/sync_driver/data_type_manager_impl.h" | 35 #include "components/sync_driver/data_type_manager_impl.h" |
| 36 #include "components/sync_driver/device_info_data_type_controller.h" | 36 #include "components/sync_driver/device_info_data_type_controller.h" |
| 37 #include "components/sync_driver/glue/typed_url_model_associator.h" | 37 #include "components/sync_driver/glue/typed_url_model_associator.h" |
| 38 #include "components/sync_driver/proxy_data_type_controller.h" | 38 #include "components/sync_driver/proxy_data_type_controller.h" |
| 39 #include "components/sync_driver/sync_client.h" | 39 #include "components/sync_driver/sync_client.h" |
| 40 #include "components/sync_driver/ui_data_type_controller.h" | 40 #include "components/sync_driver/ui_data_type_controller.h" |
| 41 #include "content/public/browser/browser_thread.h" | 41 #include "content/public/browser/browser_thread.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 sync_service->RegisterDataTypeController( | 180 sync_service->RegisterDataTypeController( |
| 181 new AutofillProfileDataTypeController(sync_client)); | 181 new AutofillProfileDataTypeController(sync_client)); |
| 182 } | 182 } |
| 183 | 183 |
| 184 // Wallet data sync is enabled by default, but behind a syncer experiment | 184 // Wallet data sync is enabled by default, but behind a syncer experiment |
| 185 // enforced by the datatype controller. Register unless explicitly disabled. | 185 // enforced by the datatype controller. Register unless explicitly disabled. |
| 186 bool wallet_disabled = disabled_types.Has(syncer::AUTOFILL_WALLET_DATA); | 186 bool wallet_disabled = disabled_types.Has(syncer::AUTOFILL_WALLET_DATA); |
| 187 if (!wallet_disabled) { | 187 if (!wallet_disabled) { |
| 188 sync_service->RegisterDataTypeController( | 188 sync_service->RegisterDataTypeController( |
| 189 new browser_sync::AutofillWalletDataTypeController( | 189 new browser_sync::AutofillWalletDataTypeController( |
| 190 sync_client, syncer::AUTOFILL_WALLET_DATA)); | 190 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 191 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), | |
| 192 base::Bind(&ChromeReportUnrecoverableError), sync_client, | |
| 193 syncer::AUTOFILL_WALLET_DATA)); | |
| 191 } | 194 } |
| 192 | 195 |
| 193 // Wallet metadata sync depends on Wallet data sync and is disabled by | 196 // Wallet metadata sync depends on Wallet data sync and is disabled by |
| 194 // default. Register if Wallet data is syncing and metadata sync is explicitly | 197 // default. Register if Wallet data is syncing and metadata sync is explicitly |
| 195 // enabled. | 198 // enabled. |
| 196 if (!wallet_disabled && enabled_types.Has(syncer::AUTOFILL_WALLET_METADATA)) { | 199 if (!wallet_disabled && enabled_types.Has(syncer::AUTOFILL_WALLET_METADATA)) { |
| 197 sync_service->RegisterDataTypeController( | 200 sync_service->RegisterDataTypeController( |
| 198 new browser_sync::AutofillWalletDataTypeController( | 201 new browser_sync::AutofillWalletDataTypeController( |
| 199 sync_client, syncer::AUTOFILL_WALLET_METADATA)); | 202 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 203 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), | |
| 204 base::Bind(&ChromeReportUnrecoverableError), sync_client, | |
| 205 syncer::AUTOFILL_WALLET_DATA)); | |
|
please use gerrit instead
2015/10/07 20:17:52
Oops, this should really be syncer::AUTOFILL_WALLE
| |
| 200 } | 206 } |
| 201 | 207 |
| 202 // Bookmark sync is enabled by default. Register unless explicitly | 208 // Bookmark sync is enabled by default. Register unless explicitly |
| 203 // disabled. | 209 // disabled. |
| 204 if (!disabled_types.Has(syncer::BOOKMARKS)) { | 210 if (!disabled_types.Has(syncer::BOOKMARKS)) { |
| 205 sync_service->RegisterDataTypeController( | 211 sync_service->RegisterDataTypeController( |
| 206 new BookmarkDataTypeController(sync_client)); | 212 new BookmarkDataTypeController(sync_client)); |
| 207 } | 213 } |
| 208 | 214 |
| 209 const bool history_disabled = | 215 const bool history_disabled = |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 new TypedUrlModelAssociator(sync_service, | 555 new TypedUrlModelAssociator(sync_service, |
| 550 history_backend, | 556 history_backend, |
| 551 error_handler); | 557 error_handler); |
| 552 TypedUrlChangeProcessor* change_processor = | 558 TypedUrlChangeProcessor* change_processor = |
| 553 new TypedUrlChangeProcessor(profile_, | 559 new TypedUrlChangeProcessor(profile_, |
| 554 model_associator, | 560 model_associator, |
| 555 history_backend, | 561 history_backend, |
| 556 error_handler); | 562 error_handler); |
| 557 return SyncComponents(model_associator, change_processor); | 563 return SyncComponents(model_associator, change_processor); |
| 558 } | 564 } |
| OLD | NEW |