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/history_delete_directives_data_type_controlle r.h" | 14 #include "chrome/browser/sync/glue/history_delete_directives_data_type_controlle r.h" |
| 15 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" | |
| 16 #include "chrome/browser/sync/glue/password_data_type_controller.h" | 15 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
| 17 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h" | 16 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h" |
| 18 #include "chrome/browser/sync/glue/sync_backend_host.h" | 17 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 19 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" | 18 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 20 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 19 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
| 21 #include "chrome/browser/sync/glue/typed_url_change_processor.h" | 20 #include "chrome/browser/sync/glue/typed_url_change_processor.h" |
| 22 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 21 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
| 23 #include "chrome/browser/sync/profile_sync_service.h" | 22 #include "chrome/browser/sync/profile_sync_service.h" |
| 24 #include "chrome/browser/sync/sessions/session_data_type_controller.h" | 23 #include "chrome/browser/sync/sessions/session_data_type_controller.h" |
| 25 #include "chrome/common/channel_info.h" | 24 #include "chrome/common/channel_info.h" |
| 26 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 28 #include "components/autofill/core/browser/autofill_wallet_data_type_controller. h" | 27 #include "components/autofill/core/browser/autofill_wallet_data_type_controller. h" |
| 29 #include "components/autofill/core/common/autofill_pref_names.h" | 28 #include "components/autofill/core/common/autofill_pref_names.h" |
| 30 #include "components/autofill/core/common/autofill_switches.h" | 29 #include "components/autofill/core/common/autofill_switches.h" |
| 31 #include "components/dom_distiller/core/dom_distiller_features.h" | 30 #include "components/dom_distiller/core/dom_distiller_features.h" |
| 32 #include "components/sync_bookmarks/bookmark_change_processor.h" | 31 #include "components/sync_bookmarks/bookmark_change_processor.h" |
| 33 #include "components/sync_bookmarks/bookmark_data_type_controller.h" | 32 #include "components/sync_bookmarks/bookmark_data_type_controller.h" |
| 34 #include "components/sync_bookmarks/bookmark_model_associator.h" | 33 #include "components/sync_bookmarks/bookmark_model_associator.h" |
| 35 #include "components/sync_driver/data_type_manager_impl.h" | 34 #include "components/sync_driver/data_type_manager_impl.h" |
| 36 #include "components/sync_driver/device_info_data_type_controller.h" | 35 #include "components/sync_driver/device_info_data_type_controller.h" |
| 37 #include "components/sync_driver/glue/chrome_report_unrecoverable_error.h" | 36 #include "components/sync_driver/glue/chrome_report_unrecoverable_error.h" |
| 38 #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/local_device_info_provider_impl.h" | |
| 39 #include "components/sync_driver/proxy_data_type_controller.h" | 39 #include "components/sync_driver/proxy_data_type_controller.h" |
| 40 #include "components/sync_driver/sync_client.h" | 40 #include "components/sync_driver/sync_client.h" |
| 41 #include "components/sync_driver/ui_data_type_controller.h" | 41 #include "components/sync_driver/ui_data_type_controller.h" |
| 42 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 43 #include "google_apis/gaia/oauth2_token_service.h" | 43 #include "google_apis/gaia/oauth2_token_service.h" |
| 44 #include "google_apis/gaia/oauth2_token_service_request.h" | 44 #include "google_apis/gaia/oauth2_token_service_request.h" |
| 45 #include "net/url_request/url_request_context_getter.h" | 45 #include "net/url_request/url_request_context_getter.h" |
| 46 #include "sync/internal_api/public/attachments/attachment_downloader.h" | 46 #include "sync/internal_api/public/attachments/attachment_downloader.h" |
| 47 #include "sync/internal_api/public/attachments/attachment_service.h" | 47 #include "sync/internal_api/public/attachments/attachment_service.h" |
| 48 #include "sync/internal_api/public/attachments/attachment_service_impl.h" | 48 #include "sync/internal_api/public/attachments/attachment_service_impl.h" |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 441 const base::FilePath& sync_folder) { | 441 const base::FilePath& sync_folder) { |
| 442 return new browser_sync::SyncBackendHostImpl( | 442 return new browser_sync::SyncBackendHostImpl( |
| 443 name, profile_, | 443 name, profile_, |
| 444 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 444 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 445 invalidator, sync_prefs, sync_folder); | 445 invalidator, sync_prefs, sync_folder); |
| 446 } | 446 } |
| 447 | 447 |
| 448 scoped_ptr<sync_driver::LocalDeviceInfoProvider> | 448 scoped_ptr<sync_driver::LocalDeviceInfoProvider> |
| 449 ProfileSyncComponentsFactoryImpl::CreateLocalDeviceInfoProvider() { | 449 ProfileSyncComponentsFactoryImpl::CreateLocalDeviceInfoProvider() { |
| 450 return scoped_ptr<sync_driver::LocalDeviceInfoProvider>( | 450 return scoped_ptr<sync_driver::LocalDeviceInfoProvider>( |
| 451 new browser_sync::LocalDeviceInfoProviderImpl()); | 451 new browser_sync::LocalDeviceInfoProviderImpl( |
| 452 chrome::GetChannel(), chrome::GetVersionString())); | |
|
stanisc
2015/10/09 17:18:02
Nice way of separating the components code and the
| |
| 452 } | 453 } |
| 453 | 454 |
| 454 class TokenServiceProvider | 455 class TokenServiceProvider |
| 455 : public OAuth2TokenServiceRequest::TokenServiceProvider { | 456 : public OAuth2TokenServiceRequest::TokenServiceProvider { |
| 456 public: | 457 public: |
| 457 TokenServiceProvider( | 458 TokenServiceProvider( |
| 458 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 459 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 459 OAuth2TokenService* token_service); | 460 OAuth2TokenService* token_service); |
| 460 | 461 |
| 461 // OAuth2TokenServiceRequest::TokenServiceProvider implementation. | 462 // OAuth2TokenServiceRequest::TokenServiceProvider implementation. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 575 new TypedUrlModelAssociator(sync_service, | 576 new TypedUrlModelAssociator(sync_service, |
| 576 history_backend, | 577 history_backend, |
| 577 error_handler); | 578 error_handler); |
| 578 TypedUrlChangeProcessor* change_processor = | 579 TypedUrlChangeProcessor* change_processor = |
| 579 new TypedUrlChangeProcessor(profile_, | 580 new TypedUrlChangeProcessor(profile_, |
| 580 model_associator, | 581 model_associator, |
| 581 history_backend, | 582 history_backend, |
| 582 error_handler); | 583 error_handler); |
| 583 return SyncComponents(model_associator, change_processor); | 584 return SyncComponents(model_associator, change_processor); |
| 584 } | 585 } |
| OLD | NEW |