| 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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/search_engines/template_url_service_factory.h" | 13 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 14 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" | |
| 15 #include "chrome/browser/sync/glue/sync_backend_host.h" | 14 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 16 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" | 15 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 17 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 16 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
| 18 #include "chrome/browser/sync/profile_sync_service.h" | 17 #include "chrome/browser/sync/profile_sync_service.h" |
| 19 #include "chrome/browser/sync/sessions/session_data_type_controller.h" | 18 #include "chrome/browser/sync/sessions/session_data_type_controller.h" |
| 20 #include "chrome/common/channel_info.h" | 19 #include "chrome/common/channel_info.h" |
| 21 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 22 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 23 #include "components/autofill/core/browser/autofill_wallet_data_type_controller.
h" | 22 #include "components/autofill/core/browser/autofill_wallet_data_type_controller.
h" |
| 24 #include "components/autofill/core/browser/webdata/autofill_data_type_controller
.h" | 23 #include "components/autofill/core/browser/webdata/autofill_data_type_controller
.h" |
| 25 #include "components/autofill/core/browser/webdata/autofill_profile_data_type_co
ntroller.h" | 24 #include "components/autofill/core/browser/webdata/autofill_profile_data_type_co
ntroller.h" |
| 26 #include "components/autofill/core/common/autofill_pref_names.h" | 25 #include "components/autofill/core/common/autofill_pref_names.h" |
| 27 #include "components/autofill/core/common/autofill_switches.h" | 26 #include "components/autofill/core/common/autofill_switches.h" |
| 28 #include "components/dom_distiller/core/dom_distiller_features.h" | 27 #include "components/dom_distiller/core/dom_distiller_features.h" |
| 29 #include "components/history/core/browser/history_delete_directives_data_type_co
ntroller.h" | 28 #include "components/history/core/browser/history_delete_directives_data_type_co
ntroller.h" |
| 30 #include "components/history/core/browser/typed_url_change_processor.h" | 29 #include "components/history/core/browser/typed_url_change_processor.h" |
| 31 #include "components/history/core/browser/typed_url_data_type_controller.h" | 30 #include "components/history/core/browser/typed_url_data_type_controller.h" |
| 32 #include "components/history/core/browser/typed_url_model_associator.h" | 31 #include "components/history/core/browser/typed_url_model_associator.h" |
| 33 #include "components/password_manager/sync/browser/password_data_type_controller
.h" | 32 #include "components/password_manager/sync/browser/password_data_type_controller
.h" |
| 34 #include "components/search_engines/search_engine_data_type_controller.h" | 33 #include "components/search_engines/search_engine_data_type_controller.h" |
| 35 #include "components/sync_bookmarks/bookmark_change_processor.h" | 34 #include "components/sync_bookmarks/bookmark_change_processor.h" |
| 36 #include "components/sync_bookmarks/bookmark_data_type_controller.h" | 35 #include "components/sync_bookmarks/bookmark_data_type_controller.h" |
| 37 #include "components/sync_bookmarks/bookmark_model_associator.h" | 36 #include "components/sync_bookmarks/bookmark_model_associator.h" |
| 38 #include "components/sync_driver/data_type_manager_impl.h" | 37 #include "components/sync_driver/data_type_manager_impl.h" |
| 39 #include "components/sync_driver/device_info_data_type_controller.h" | 38 #include "components/sync_driver/device_info_data_type_controller.h" |
| 40 #include "components/sync_driver/glue/chrome_report_unrecoverable_error.h" | 39 #include "components/sync_driver/glue/chrome_report_unrecoverable_error.h" |
| 40 #include "components/sync_driver/local_device_info_provider_impl.h" |
| 41 #include "components/sync_driver/proxy_data_type_controller.h" | 41 #include "components/sync_driver/proxy_data_type_controller.h" |
| 42 #include "components/sync_driver/sync_client.h" | 42 #include "components/sync_driver/sync_client.h" |
| 43 #include "components/sync_driver/ui_data_type_controller.h" | 43 #include "components/sync_driver/ui_data_type_controller.h" |
| 44 #include "content/public/browser/browser_thread.h" | 44 #include "content/public/browser/browser_thread.h" |
| 45 #include "google_apis/gaia/oauth2_token_service.h" | 45 #include "google_apis/gaia/oauth2_token_service.h" |
| 46 #include "google_apis/gaia/oauth2_token_service_request.h" | 46 #include "google_apis/gaia/oauth2_token_service_request.h" |
| 47 #include "net/url_request/url_request_context_getter.h" | 47 #include "net/url_request/url_request_context_getter.h" |
| 48 #include "sync/internal_api/public/attachments/attachment_downloader.h" | 48 #include "sync/internal_api/public/attachments/attachment_downloader.h" |
| 49 #include "sync/internal_api/public/attachments/attachment_service.h" | 49 #include "sync/internal_api/public/attachments/attachment_service.h" |
| 50 #include "sync/internal_api/public/attachments/attachment_service_impl.h" | 50 #include "sync/internal_api/public/attachments/attachment_service_impl.h" |
| 51 #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" | 51 #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" |
| 52 #include "ui/base/device_form_factor.h" |
| 52 | 53 |
| 53 #if defined(ENABLE_APP_LIST) | 54 #if defined(ENABLE_APP_LIST) |
| 54 #include "ui/app_list/app_list_switches.h" | 55 #include "ui/app_list/app_list_switches.h" |
| 55 #endif | 56 #endif |
| 56 | 57 |
| 57 #if defined(ENABLE_EXTENSIONS) | 58 #if defined(ENABLE_EXTENSIONS) |
| 58 #include "chrome/browser/sync/glue/extension_data_type_controller.h" | 59 #include "chrome/browser/sync/glue/extension_data_type_controller.h" |
| 59 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" | 60 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" |
| 60 #endif | 61 #endif |
| 61 | 62 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 const base::FilePath& sync_folder) { | 412 const base::FilePath& sync_folder) { |
| 412 return new browser_sync::SyncBackendHostImpl( | 413 return new browser_sync::SyncBackendHostImpl( |
| 413 name, profile_, sync_client, | 414 name, profile_, sync_client, |
| 414 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 415 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 415 invalidator, sync_prefs, sync_folder); | 416 invalidator, sync_prefs, sync_folder); |
| 416 } | 417 } |
| 417 | 418 |
| 418 scoped_ptr<sync_driver::LocalDeviceInfoProvider> | 419 scoped_ptr<sync_driver::LocalDeviceInfoProvider> |
| 419 ProfileSyncComponentsFactoryImpl::CreateLocalDeviceInfoProvider() { | 420 ProfileSyncComponentsFactoryImpl::CreateLocalDeviceInfoProvider() { |
| 420 return scoped_ptr<sync_driver::LocalDeviceInfoProvider>( | 421 return scoped_ptr<sync_driver::LocalDeviceInfoProvider>( |
| 421 new browser_sync::LocalDeviceInfoProviderImpl()); | 422 new browser_sync::LocalDeviceInfoProviderImpl( |
| 423 chrome::GetChannel(), |
| 424 chrome::GetVersionString(), |
| 425 ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET)); |
| 422 } | 426 } |
| 423 | 427 |
| 424 class TokenServiceProvider | 428 class TokenServiceProvider |
| 425 : public OAuth2TokenServiceRequest::TokenServiceProvider { | 429 : public OAuth2TokenServiceRequest::TokenServiceProvider { |
| 426 public: | 430 public: |
| 427 TokenServiceProvider( | 431 TokenServiceProvider( |
| 428 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 432 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 429 OAuth2TokenService* token_service); | 433 OAuth2TokenService* token_service); |
| 430 | 434 |
| 431 // OAuth2TokenServiceRequest::TokenServiceProvider implementation. | 435 // OAuth2TokenServiceRequest::TokenServiceProvider implementation. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // |sync_service_| member, and make GetSyncService require it be called on | 550 // |sync_service_| member, and make GetSyncService require it be called on |
| 547 // the UI thread. | 551 // the UI thread. |
| 548 TypedUrlModelAssociator* model_associator = | 552 TypedUrlModelAssociator* model_associator = |
| 549 new TypedUrlModelAssociator(sync_service, | 553 new TypedUrlModelAssociator(sync_service, |
| 550 history_backend, | 554 history_backend, |
| 551 error_handler); | 555 error_handler); |
| 552 TypedUrlChangeProcessor* change_processor = new TypedUrlChangeProcessor( | 556 TypedUrlChangeProcessor* change_processor = new TypedUrlChangeProcessor( |
| 553 model_associator, history_backend, error_handler, ui_thread); | 557 model_associator, history_backend, error_handler, ui_thread); |
| 554 return SyncComponents(model_associator, change_processor); | 558 return SyncComponents(model_associator, change_processor); |
| 555 } | 559 } |
| OLD | NEW |