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 sync_service->RegisterDataTypeController( |
214 error_callback, sync_client_, history_disabled_pref_)); | 214 base::MakeUnique<ModelTypeController>(syncer::TYPED_URLS, |
215 sync_client_, db_thread_)); | |
skym
2017/03/03 17:41:09
db_thread_ ? Are you sure that's right? I don't se
Gang Wu
2017/03/06 08:21:24
will add real implementation later, so add TODO he
| |
216 } else { | |
217 sync_service->RegisterDataTypeController( | |
218 base::MakeUnique<TypedUrlDataTypeController>( | |
219 error_callback, sync_client_, history_disabled_pref_)); | |
220 } | |
215 } | 221 } |
216 | 222 |
217 // Delete directive sync is enabled by default. Register unless full history | 223 // Delete directive sync is enabled by default. Register unless full history |
218 // sync is disabled. | 224 // sync is disabled. |
219 if (!disabled_types.Has(syncer::HISTORY_DELETE_DIRECTIVES) && | 225 if (!disabled_types.Has(syncer::HISTORY_DELETE_DIRECTIVES) && |
220 !history_disabled) { | 226 !history_disabled) { |
221 sync_service->RegisterDataTypeController( | 227 sync_service->RegisterDataTypeController( |
222 base::MakeUnique<HistoryDeleteDirectivesDataTypeController>( | 228 base::MakeUnique<HistoryDeleteDirectivesDataTypeController>( |
223 error_callback, sync_client_)); | 229 error_callback, sync_client_)); |
224 } | 230 } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 | 446 |
441 // static | 447 // static |
442 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { | 448 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { |
443 override_prefs_controller_to_uss_for_test_ = use_uss; | 449 override_prefs_controller_to_uss_for_test_ = use_uss; |
444 } | 450 } |
445 | 451 |
446 bool ProfileSyncComponentsFactoryImpl:: | 452 bool ProfileSyncComponentsFactoryImpl:: |
447 override_prefs_controller_to_uss_for_test_ = false; | 453 override_prefs_controller_to_uss_for_test_ = false; |
448 | 454 |
449 } // namespace browser_sync | 455 } // namespace browser_sync |
OLD | NEW |