| 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/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 sync_service->RegisterDataTypeController( | 202 sync_service->RegisterDataTypeController( |
| 203 base::MakeUnique<BookmarkDataTypeController>(error_callback, | 203 base::MakeUnique<BookmarkDataTypeController>(error_callback, |
| 204 sync_client_)); | 204 sync_client_)); |
| 205 } | 205 } |
| 206 | 206 |
| 207 const bool history_disabled = | 207 const bool history_disabled = |
| 208 sync_client_->GetPrefService()->GetBoolean(history_disabled_pref_); | 208 sync_client_->GetPrefService()->GetBoolean(history_disabled_pref_); |
| 209 // TypedUrl sync is enabled by default. Register unless explicitly disabled, | 209 // TypedUrl sync is enabled by default. Register unless explicitly disabled, |
| 210 // or if saving history is disabled. | 210 // or if saving history is disabled. |
| 211 if (!disabled_types.Has(syncer::TYPED_URLS) && !history_disabled) { | 211 if (!disabled_types.Has(syncer::TYPED_URLS) && !history_disabled) { |
| 212 sync_service->RegisterDataTypeController( | 212 if (base::FeatureList::IsEnabled(switches::kSyncUSSTypedURL)) { |
| 213 base::MakeUnique<TypedUrlDataTypeController>( | 213 // TODO(gangwu): Register controller here once typed url controller |
| 214 error_callback, sync_client_, history_disabled_pref_)); | 214 // implemented. |
| 215 } else { |
| 216 sync_service->RegisterDataTypeController( |
| 217 base::MakeUnique<TypedUrlDataTypeController>( |
| 218 error_callback, sync_client_, history_disabled_pref_)); |
| 219 } |
| 215 } | 220 } |
| 216 | 221 |
| 217 // Delete directive sync is enabled by default. Register unless full history | 222 // Delete directive sync is enabled by default. Register unless full history |
| 218 // sync is disabled. | 223 // sync is disabled. |
| 219 if (!disabled_types.Has(syncer::HISTORY_DELETE_DIRECTIVES) && | 224 if (!disabled_types.Has(syncer::HISTORY_DELETE_DIRECTIVES) && |
| 220 !history_disabled) { | 225 !history_disabled) { |
| 221 sync_service->RegisterDataTypeController( | 226 sync_service->RegisterDataTypeController( |
| 222 base::MakeUnique<HistoryDeleteDirectivesDataTypeController>( | 227 base::MakeUnique<HistoryDeleteDirectivesDataTypeController>( |
| 223 error_callback, sync_client_)); | 228 error_callback, sync_client_)); |
| 224 } | 229 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 | 445 |
| 441 // static | 446 // static |
| 442 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { | 447 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { |
| 443 override_prefs_controller_to_uss_for_test_ = use_uss; | 448 override_prefs_controller_to_uss_for_test_ = use_uss; |
| 444 } | 449 } |
| 445 | 450 |
| 446 bool ProfileSyncComponentsFactoryImpl:: | 451 bool ProfileSyncComponentsFactoryImpl:: |
| 447 override_prefs_controller_to_uss_for_test_ = false; | 452 override_prefs_controller_to_uss_for_test_ = false; |
| 448 | 453 |
| 449 } // namespace browser_sync | 454 } // namespace browser_sync |
| OLD | NEW |