Chromium Code Reviews| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 base::MakeUnique<ModelTypeController>( | 145 base::MakeUnique<ModelTypeController>( |
| 146 syncer::DEVICE_INFO, base::Bind(&base::debug::DumpWithoutCrashing), | 146 syncer::DEVICE_INFO, base::Bind(&base::debug::DumpWithoutCrashing), |
| 147 sync_client_, base::ThreadTaskRunnerHandle::Get())); | 147 sync_client_, base::ThreadTaskRunnerHandle::Get())); |
| 148 } else { | 148 } else { |
| 149 sync_service->RegisterDataTypeController( | 149 sync_service->RegisterDataTypeController( |
| 150 base::MakeUnique<DeviceInfoDataTypeController>( | 150 base::MakeUnique<DeviceInfoDataTypeController>( |
| 151 error_callback, sync_client_, | 151 error_callback, sync_client_, |
| 152 sync_service->GetLocalDeviceInfoProvider())); | 152 sync_service->GetLocalDeviceInfoProvider())); |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Autofill sync is enabled by default. Register unless explicitly | 155 // Autofill sync is enabled by default. Register unless explicitly |
|
Mathieu
2016/11/23 12:47:21
I wish this was called "Autocomplete" now. What we
Patrick Noland
2016/11/29 00:09:50
Done.
| |
| 156 // disabled. | 156 // disabled. |
| 157 if (!disabled_types.Has(syncer::AUTOFILL)) { | 157 if (!disabled_types.Has(syncer::AUTOFILL)) { |
| 158 sync_service->RegisterDataTypeController( | 158 if (base::FeatureList::IsEnabled(switches::kSyncUSSAutocomplete)) { |
| 159 base::MakeUnique<AutofillDataTypeController>( | 159 sync_service->RegisterDataTypeController( |
| 160 db_thread_, error_callback, sync_client_, web_data_service_)); | 160 base::MakeUnique<ModelTypeController>( |
| 161 syncer::AUTOFILL, base::Bind(&base::debug::DumpWithoutCrashing), | |
| 162 sync_client_, db_thread_)); | |
| 163 } else { | |
| 164 sync_service->RegisterDataTypeController( | |
| 165 base::MakeUnique<AutofillDataTypeController>( | |
| 166 db_thread_, error_callback, sync_client_, web_data_service_)); | |
| 167 } | |
| 161 } | 168 } |
| 162 | 169 |
| 163 // Autofill profile sync is enabled by default. Register unless explicitly | 170 // Autofill profile sync is enabled by default. Register unless explicitly |
| 164 // disabled. | 171 // disabled. |
| 165 if (!disabled_types.Has(syncer::AUTOFILL_PROFILE)) { | 172 if (!disabled_types.Has(syncer::AUTOFILL_PROFILE)) { |
| 166 sync_service->RegisterDataTypeController( | 173 sync_service->RegisterDataTypeController( |
| 167 base::MakeUnique<AutofillProfileDataTypeController>( | 174 base::MakeUnique<AutofillProfileDataTypeController>( |
| 168 db_thread_, error_callback, sync_client_, web_data_service_)); | 175 db_thread_, error_callback, sync_client_, web_data_service_)); |
| 169 } | 176 } |
| 170 | 177 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 418 | 425 |
| 419 // static | 426 // static |
| 420 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { | 427 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { |
| 421 override_prefs_controller_to_uss_for_test_ = use_uss; | 428 override_prefs_controller_to_uss_for_test_ = use_uss; |
| 422 } | 429 } |
| 423 | 430 |
| 424 bool ProfileSyncComponentsFactoryImpl:: | 431 bool ProfileSyncComponentsFactoryImpl:: |
| 425 override_prefs_controller_to_uss_for_test_ = false; | 432 override_prefs_controller_to_uss_for_test_ = false; |
| 426 | 433 |
| 427 } // namespace browser_sync | 434 } // namespace browser_sync |
| OLD | NEW |