| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
| 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 10 #include "chrome/browser/history/history_service.h" | 10 #include "chrome/browser/history/history_service.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "components/password_manager/core/browser/password_store.h" | 52 #include "components/password_manager/core/browser/password_store.h" |
| 53 #include "components/search_engines/template_url_service.h" | 53 #include "components/search_engines/template_url_service.h" |
| 54 #include "components/signin/core/browser/signin_manager.h" | 54 #include "components/signin/core/browser/signin_manager.h" |
| 55 #include "components/sync_driver/data_type_manager_impl.h" | 55 #include "components/sync_driver/data_type_manager_impl.h" |
| 56 #include "components/sync_driver/data_type_manager_observer.h" | 56 #include "components/sync_driver/data_type_manager_observer.h" |
| 57 #include "components/sync_driver/device_info_data_type_controller.h" | 57 #include "components/sync_driver/device_info_data_type_controller.h" |
| 58 #include "components/sync_driver/generic_change_processor.h" | 58 #include "components/sync_driver/generic_change_processor.h" |
| 59 #include "components/sync_driver/proxy_data_type_controller.h" | 59 #include "components/sync_driver/proxy_data_type_controller.h" |
| 60 #include "components/sync_driver/shared_change_processor.h" | 60 #include "components/sync_driver/shared_change_processor.h" |
| 61 #include "components/sync_driver/ui_data_type_controller.h" | 61 #include "components/sync_driver/ui_data_type_controller.h" |
| 62 #include "components/wifi_sync/wifi_credential_syncable_service.h" |
| 63 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" |
| 62 #include "content/public/browser/browser_thread.h" | 64 #include "content/public/browser/browser_thread.h" |
| 63 #include "google_apis/gaia/oauth2_token_service_request.h" | 65 #include "google_apis/gaia/oauth2_token_service_request.h" |
| 64 #include "net/url_request/url_request_context_getter.h" | 66 #include "net/url_request/url_request_context_getter.h" |
| 65 #include "sync/api/syncable_service.h" | 67 #include "sync/api/syncable_service.h" |
| 66 #include "sync/internal_api/public/attachments/attachment_downloader.h" | 68 #include "sync/internal_api/public/attachments/attachment_downloader.h" |
| 67 #include "sync/internal_api/public/attachments/attachment_service.h" | 69 #include "sync/internal_api/public/attachments/attachment_service.h" |
| 68 #include "sync/internal_api/public/attachments/attachment_service_impl.h" | 70 #include "sync/internal_api/public/attachments/attachment_service_impl.h" |
| 69 #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" | 71 #include "sync/internal_api/public/attachments/attachment_uploader_impl.h" |
| 70 | 72 |
| 71 #if defined(ENABLE_APP_LIST) | 73 #if defined(ENABLE_APP_LIST) |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 new SupervisedUserSyncDataTypeController( | 412 new SupervisedUserSyncDataTypeController( |
| 411 syncer::SUPERVISED_USERS, | 413 syncer::SUPERVISED_USERS, |
| 412 this, | 414 this, |
| 413 profile_)); | 415 profile_)); |
| 414 pss->RegisterDataTypeController( | 416 pss->RegisterDataTypeController( |
| 415 new SupervisedUserSyncDataTypeController( | 417 new SupervisedUserSyncDataTypeController( |
| 416 syncer::SUPERVISED_USER_SHARED_SETTINGS, | 418 syncer::SUPERVISED_USER_SHARED_SETTINGS, |
| 417 this, | 419 this, |
| 418 profile_)); | 420 profile_)); |
| 419 #endif | 421 #endif |
| 422 |
| 423 if (command_line_->HasSwitch(switches::kEnableWifiCredentialSync) && |
| 424 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) { |
| 425 pss->RegisterDataTypeController( |
| 426 new UIDataTypeController( |
| 427 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
| 428 base::Bind(&ChromeReportUnrecoverableError), |
| 429 syncer::WIFI_CREDENTIALS, |
| 430 this)); |
| 431 } |
| 420 } | 432 } |
| 421 | 433 |
| 422 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( | 434 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( |
| 423 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 435 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
| 424 debug_info_listener, | 436 debug_info_listener, |
| 425 const DataTypeController::TypeMap* controllers, | 437 const DataTypeController::TypeMap* controllers, |
| 426 const sync_driver::DataTypeEncryptionHandler* encryption_handler, | 438 const sync_driver::DataTypeEncryptionHandler* encryption_handler, |
| 427 SyncBackendHost* backend, | 439 SyncBackendHost* backend, |
| 428 DataTypeManagerObserver* observer) { | 440 DataTypeManagerObserver* observer) { |
| 429 return new DataTypeManagerImpl(base::Bind(ChromeReportUnrecoverableError), | 441 return new DataTypeManagerImpl(base::Bind(ChromeReportUnrecoverableError), |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 #if defined(PASSWORD_MANAGER_ENABLE_SYNC) | 567 #if defined(PASSWORD_MANAGER_ENABLE_SYNC) |
| 556 scoped_refptr<password_manager::PasswordStore> password_store = | 568 scoped_refptr<password_manager::PasswordStore> password_store = |
| 557 PasswordStoreFactory::GetForProfile(profile_, | 569 PasswordStoreFactory::GetForProfile(profile_, |
| 558 Profile::EXPLICIT_ACCESS); | 570 Profile::EXPLICIT_ACCESS); |
| 559 return password_store.get() ? password_store->GetPasswordSyncableService() | 571 return password_store.get() ? password_store->GetPasswordSyncableService() |
| 560 : base::WeakPtr<syncer::SyncableService>(); | 572 : base::WeakPtr<syncer::SyncableService>(); |
| 561 #else | 573 #else |
| 562 return base::WeakPtr<syncer::SyncableService>(); | 574 return base::WeakPtr<syncer::SyncableService>(); |
| 563 #endif | 575 #endif |
| 564 } | 576 } |
| 577 #if defined(OS_CHROMEOS) |
| 578 case syncer::WIFI_CREDENTIALS: |
| 579 return wifi_sync::WifiCredentialSyncableServiceFactory:: |
| 580 GetForBrowserContext(profile_)->AsWeakPtr(); |
| 581 #endif |
| 565 default: | 582 default: |
| 566 // The following datatypes still need to be transitioned to the | 583 // The following datatypes still need to be transitioned to the |
| 567 // syncer::SyncableService API: | 584 // syncer::SyncableService API: |
| 568 // Bookmarks | 585 // Bookmarks |
| 569 // Typed URLs | 586 // Typed URLs |
| 570 NOTREACHED(); | 587 NOTREACHED(); |
| 571 return base::WeakPtr<syncer::SyncableService>(); | 588 return base::WeakPtr<syncer::SyncableService>(); |
| 572 } | 589 } |
| 573 } | 590 } |
| 574 | 591 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 new TypedUrlModelAssociator(profile_sync_service, | 717 new TypedUrlModelAssociator(profile_sync_service, |
| 701 history_backend, | 718 history_backend, |
| 702 error_handler); | 719 error_handler); |
| 703 TypedUrlChangeProcessor* change_processor = | 720 TypedUrlChangeProcessor* change_processor = |
| 704 new TypedUrlChangeProcessor(profile_, | 721 new TypedUrlChangeProcessor(profile_, |
| 705 model_associator, | 722 model_associator, |
| 706 history_backend, | 723 history_backend, |
| 707 error_handler); | 724 error_handler); |
| 708 return SyncComponents(model_associator, change_processor); | 725 return SyncComponents(model_associator, change_processor); |
| 709 } | 726 } |
| OLD | NEW |