| 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/debug/dump_without_crashing.h" | 9 #include "base/debug/dump_without_crashing.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "components/sync_bookmarks/bookmark_model_associator.h" | 45 #include "components/sync_bookmarks/bookmark_model_associator.h" |
| 46 #include "components/sync_sessions/session_data_type_controller.h" | 46 #include "components/sync_sessions/session_data_type_controller.h" |
| 47 #include "google_apis/gaia/oauth2_token_service.h" | 47 #include "google_apis/gaia/oauth2_token_service.h" |
| 48 #include "google_apis/gaia/oauth2_token_service_request.h" | 48 #include "google_apis/gaia/oauth2_token_service_request.h" |
| 49 #include "net/url_request/url_request_context_getter.h" | 49 #include "net/url_request/url_request_context_getter.h" |
| 50 | 50 |
| 51 using bookmarks::BookmarkModel; | 51 using bookmarks::BookmarkModel; |
| 52 using sync_bookmarks::BookmarkChangeProcessor; | 52 using sync_bookmarks::BookmarkChangeProcessor; |
| 53 using sync_bookmarks::BookmarkDataTypeController; | 53 using sync_bookmarks::BookmarkDataTypeController; |
| 54 using sync_bookmarks::BookmarkModelAssociator; | 54 using sync_bookmarks::BookmarkModelAssociator; |
| 55 using sync_sessions::SessionDataTypeController; |
| 56 using syncer::AsyncDirectoryTypeController; |
| 55 using syncer::DataTypeController; | 57 using syncer::DataTypeController; |
| 56 using syncer::DataTypeManager; | 58 using syncer::DataTypeManager; |
| 57 using syncer::DataTypeManagerImpl; | 59 using syncer::DataTypeManagerImpl; |
| 58 using syncer::DataTypeManagerObserver; | 60 using syncer::DataTypeManagerObserver; |
| 59 using syncer::DeviceInfoDataTypeController; | 61 using syncer::DeviceInfoDataTypeController; |
| 62 using syncer::ModelTypeController; |
| 60 using syncer::ProxyDataTypeController; | 63 using syncer::ProxyDataTypeController; |
| 61 using syncer::ModelTypeController; | |
| 62 using syncer::AsyncDirectoryTypeController; | |
| 63 using sync_sessions::SessionDataTypeController; | |
| 64 | 64 |
| 65 namespace browser_sync { | 65 namespace browser_sync { |
| 66 | 66 |
| 67 namespace { | 67 namespace { |
| 68 | 68 |
| 69 syncer::ModelTypeSet GetDisabledTypesFromCommandLine( | 69 syncer::ModelTypeSet GetDisabledTypesFromCommandLine( |
| 70 const base::CommandLine& command_line) { | 70 const base::CommandLine& command_line) { |
| 71 syncer::ModelTypeSet disabled_types; | 71 syncer::ModelTypeSet disabled_types; |
| 72 std::string disabled_types_str = | 72 std::string disabled_types_str = |
| 73 command_line.GetSwitchValueASCII(switches::kDisableSyncTypes); | 73 command_line.GetSwitchValueASCII(switches::kDisableSyncTypes); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Reading List or Reading List Sync is explicitly disabled. | 290 // Reading List or Reading List Sync is explicitly disabled. |
| 291 if (!disabled_types.Has(syncer::READING_LIST) && | 291 if (!disabled_types.Has(syncer::READING_LIST) && |
| 292 reading_list::switches::IsReadingListEnabled()) { | 292 reading_list::switches::IsReadingListEnabled()) { |
| 293 sync_service->RegisterDataTypeController( | 293 sync_service->RegisterDataTypeController( |
| 294 base::MakeUnique<ModelTypeController>( | 294 base::MakeUnique<ModelTypeController>( |
| 295 syncer::READING_LIST, error_callback, sync_client_, ui_thread_)); | 295 syncer::READING_LIST, error_callback, sync_client_, ui_thread_)); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 | 298 |
| 299 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( | 299 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( |
| 300 syncer::ModelTypeSet initial_types, |
| 300 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 301 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
| 301 debug_info_listener, | 302 debug_info_listener, |
| 302 const DataTypeController::TypeMap* controllers, | 303 const DataTypeController::TypeMap* controllers, |
| 303 const syncer::DataTypeEncryptionHandler* encryption_handler, | 304 const syncer::DataTypeEncryptionHandler* encryption_handler, |
| 304 syncer::SyncEngine* engine, | 305 syncer::ModelTypeConfigurer* configurer, |
| 305 DataTypeManagerObserver* observer) { | 306 DataTypeManagerObserver* observer) { |
| 306 return new DataTypeManagerImpl(debug_info_listener, controllers, | 307 return new DataTypeManagerImpl(initial_types, debug_info_listener, |
| 307 encryption_handler, engine, observer); | 308 controllers, encryption_handler, configurer, |
| 309 observer); |
| 308 } | 310 } |
| 309 | 311 |
| 310 syncer::SyncEngine* ProfileSyncComponentsFactoryImpl::CreateSyncEngine( | 312 syncer::SyncEngine* ProfileSyncComponentsFactoryImpl::CreateSyncEngine( |
| 311 const std::string& name, | 313 const std::string& name, |
| 312 invalidation::InvalidationService* invalidator, | 314 invalidation::InvalidationService* invalidator, |
| 313 const base::WeakPtr<syncer::SyncPrefs>& sync_prefs, | 315 const base::WeakPtr<syncer::SyncPrefs>& sync_prefs, |
| 314 const base::FilePath& sync_folder) { | 316 const base::FilePath& sync_folder) { |
| 315 return new syncer::SyncBackendHostImpl(name, sync_client_, invalidator, | 317 return new syncer::SyncBackendHostImpl(name, sync_client_, invalidator, |
| 316 sync_prefs, sync_folder); | 318 sync_prefs, sync_folder); |
| 317 } | 319 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 431 |
| 430 // static | 432 // static |
| 431 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { | 433 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { |
| 432 override_prefs_controller_to_uss_for_test_ = use_uss; | 434 override_prefs_controller_to_uss_for_test_ = use_uss; |
| 433 } | 435 } |
| 434 | 436 |
| 435 bool ProfileSyncComponentsFactoryImpl:: | 437 bool ProfileSyncComponentsFactoryImpl:: |
| 436 override_prefs_controller_to_uss_for_test_ = false; | 438 override_prefs_controller_to_uss_for_test_ = false; |
| 437 | 439 |
| 438 } // namespace browser_sync | 440 } // namespace browser_sync |
| OLD | NEW |