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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 base::MakeUnique<UIDataTypeController>(syncer::PRIORITY_PREFERENCES, | 267 base::MakeUnique<UIDataTypeController>(syncer::PRIORITY_PREFERENCES, |
268 error_callback, sync_client_)); | 268 error_callback, sync_client_)); |
269 } | 269 } |
270 | 270 |
271 // Article sync is disabled by default. Register only if explicitly enabled. | 271 // Article sync is disabled by default. Register only if explicitly enabled. |
272 if (dom_distiller::IsEnableSyncArticlesSet()) { | 272 if (dom_distiller::IsEnableSyncArticlesSet()) { |
273 sync_service->RegisterDataTypeController( | 273 sync_service->RegisterDataTypeController( |
274 base::MakeUnique<UIDataTypeController>(syncer::ARTICLES, error_callback, | 274 base::MakeUnique<UIDataTypeController>(syncer::ARTICLES, error_callback, |
275 sync_client_)); | 275 sync_client_)); |
276 } | 276 } |
277 // Reading list sync is disabled by default. Register only if explicitly | 277 |
278 // enabled. | 278 #if defined(OS_IOS) |
pavely
2016/11/20 02:31:58
Yes, this is a correct way to only enable type on
Olivier
2016/11/20 10:32:33
Acknowledged.
| |
279 if (enabled_types.Has(syncer::READING_LIST)) { | 279 // Reading list sync is enabled by default only on iOS. Register unless |
280 // explicitly disabled. | |
281 if (!disabled_types.Has(syncer::READING_LIST)) { | |
280 sync_service->RegisterDataTypeController( | 282 sync_service->RegisterDataTypeController( |
281 base::MakeUnique<ModelTypeController>( | 283 base::MakeUnique<ModelTypeController>( |
282 syncer::READING_LIST, error_callback, sync_client_, | 284 syncer::READING_LIST, error_callback, sync_client_, |
283 base::ThreadTaskRunnerHandle::Get())); | 285 base::ThreadTaskRunnerHandle::Get())); |
284 } | 286 } |
287 #endif | |
285 } | 288 } |
286 | 289 |
287 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( | 290 DataTypeManager* ProfileSyncComponentsFactoryImpl::CreateDataTypeManager( |
288 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 291 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
289 debug_info_listener, | 292 debug_info_listener, |
290 const DataTypeController::TypeMap* controllers, | 293 const DataTypeController::TypeMap* controllers, |
291 const syncer::DataTypeEncryptionHandler* encryption_handler, | 294 const syncer::DataTypeEncryptionHandler* encryption_handler, |
292 syncer::SyncBackendHost* backend, | 295 syncer::SyncBackendHost* backend, |
293 DataTypeManagerObserver* observer) { | 296 DataTypeManagerObserver* observer) { |
294 return new DataTypeManagerImpl(debug_info_listener, controllers, | 297 return new DataTypeManagerImpl(debug_info_listener, controllers, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
418 | 421 |
419 // static | 422 // static |
420 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { | 423 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { |
421 override_prefs_controller_to_uss_for_test_ = use_uss; | 424 override_prefs_controller_to_uss_for_test_ = use_uss; |
422 } | 425 } |
423 | 426 |
424 bool ProfileSyncComponentsFactoryImpl:: | 427 bool ProfileSyncComponentsFactoryImpl:: |
425 override_prefs_controller_to_uss_for_test_ = false; | 428 override_prefs_controller_to_uss_for_test_ = false; |
426 | 429 |
427 } // namespace browser_sync | 430 } // namespace browser_sync |
OLD | NEW |