| 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/browser/profile_sync_components_factory_impl.h
" | 5 #include "components/browser_sync/browser/profile_sync_components_factory_impl.h
" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 } | 143 } |
| 144 | 144 |
| 145 void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( | 145 void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( |
| 146 sync_driver::SyncService* sync_service, | 146 sync_driver::SyncService* sync_service, |
| 147 syncer::ModelTypeSet disabled_types, | 147 syncer::ModelTypeSet disabled_types, |
| 148 syncer::ModelTypeSet enabled_types) { | 148 syncer::ModelTypeSet enabled_types) { |
| 149 base::Closure error_callback = | 149 base::Closure error_callback = |
| 150 base::Bind(&ChromeReportUnrecoverableError, channel_); | 150 base::Bind(&ChromeReportUnrecoverableError, channel_); |
| 151 | 151 |
| 152 // TODO(stanisc): can DEVICE_INFO be one of disabled datatypes? | 152 // TODO(stanisc): can DEVICE_INFO be one of disabled datatypes? |
| 153 if (channel_ == version_info::Channel::UNKNOWN && | 153 if (base::FeatureList::IsEnabled(switches::kSyncUSSDeviceInfo)) { |
| 154 command_line_.HasSwitch(switches::kSyncEnableUSSDeviceInfo)) { | |
| 155 sync_service->RegisterDataTypeController( | 154 sync_service->RegisterDataTypeController( |
| 156 base::MakeUnique<UIModelTypeController>(syncer::DEVICE_INFO, | 155 base::MakeUnique<UIModelTypeController>(syncer::DEVICE_INFO, |
| 157 error_callback, sync_client_)); | 156 error_callback, sync_client_)); |
| 158 } else { | 157 } else { |
| 159 sync_service->RegisterDataTypeController( | 158 sync_service->RegisterDataTypeController( |
| 160 base::MakeUnique<DeviceInfoDataTypeController>( | 159 base::MakeUnique<DeviceInfoDataTypeController>( |
| 161 error_callback, sync_client_, | 160 error_callback, sync_client_, |
| 162 sync_service->GetLocalDeviceInfoProvider())); | 161 sync_service->GetLocalDeviceInfoProvider())); |
| 163 } | 162 } |
| 164 | 163 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 return SyncComponents(model_associator, change_processor); | 419 return SyncComponents(model_associator, change_processor); |
| 421 } | 420 } |
| 422 | 421 |
| 423 // static | 422 // static |
| 424 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { | 423 void ProfileSyncComponentsFactoryImpl::OverridePrefsForUssTest(bool use_uss) { |
| 425 override_prefs_controller_to_uss_for_test_ = use_uss; | 424 override_prefs_controller_to_uss_for_test_ = use_uss; |
| 426 } | 425 } |
| 427 | 426 |
| 428 bool ProfileSyncComponentsFactoryImpl:: | 427 bool ProfileSyncComponentsFactoryImpl:: |
| 429 override_prefs_controller_to_uss_for_test_ = false; | 428 override_prefs_controller_to_uss_for_test_ = false; |
| OLD | NEW |