| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/sync/chrome_sync_client.h" | 5 #include "chrome/browser/sync/chrome_sync_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 // Component factory may already be set in tests. | 200 // Component factory may already be set in tests. |
| 201 if (!GetSyncApiComponentFactory()) { | 201 if (!GetSyncApiComponentFactory()) { |
| 202 const GURL sync_service_url = syncer::GetSyncServiceURL( | 202 const GURL sync_service_url = syncer::GetSyncServiceURL( |
| 203 *base::CommandLine::ForCurrentProcess(), chrome::GetChannel()); | 203 *base::CommandLine::ForCurrentProcess(), chrome::GetChannel()); |
| 204 ProfileOAuth2TokenService* token_service = | 204 ProfileOAuth2TokenService* token_service = |
| 205 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 205 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
| 206 net::URLRequestContextGetter* url_request_context_getter = | 206 net::URLRequestContextGetter* url_request_context_getter = |
| 207 profile_->GetRequestContext(); | 207 profile_->GetRequestContext(); |
| 208 | 208 |
| 209 component_factory_.reset(new ProfileSyncComponentsFactoryImpl( | 209 component_factory_ = base::MakeUnique<ProfileSyncComponentsFactoryImpl>( |
| 210 this, chrome::GetChannel(), chrome::GetVersionString(), | 210 this, chrome::GetChannel(), chrome::GetVersionString(), |
| 211 ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET, | 211 ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET, |
| 212 *base::CommandLine::ForCurrentProcess(), | 212 *base::CommandLine::ForCurrentProcess(), |
| 213 prefs::kSavingBrowserHistoryDisabled, sync_service_url, | 213 prefs::kSavingBrowserHistoryDisabled, sync_service_url, |
| 214 content::BrowserThread::GetTaskRunnerForThread( | 214 content::BrowserThread::GetTaskRunnerForThread( |
| 215 content::BrowserThread::UI), | 215 content::BrowserThread::UI), |
| 216 content::BrowserThread::GetTaskRunnerForThread( | 216 content::BrowserThread::GetTaskRunnerForThread( |
| 217 content::BrowserThread::DB), | 217 content::BrowserThread::DB), |
| 218 token_service, url_request_context_getter, web_data_service_, | 218 token_service, url_request_context_getter, web_data_service_, |
| 219 password_store_)); | 219 password_store_); |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 syncer::SyncService* ChromeSyncClient::GetSyncService() { | 223 syncer::SyncService* ChromeSyncClient::GetSyncService() { |
| 224 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 224 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 225 return ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile_); | 225 return ProfileSyncServiceFactory::GetSyncServiceForBrowserContext(profile_); |
| 226 } | 226 } |
| 227 | 227 |
| 228 PrefService* ChromeSyncClient::GetPrefService() { | 228 PrefService* ChromeSyncClient::GetPrefService() { |
| 229 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 229 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 sync_service->RegisterDataTypeController( | 627 sync_service->RegisterDataTypeController( |
| 628 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 628 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 629 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 629 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
| 630 sync_service->RegisterDataTypeController( | 630 sync_service->RegisterDataTypeController( |
| 631 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 631 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 632 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 632 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 633 #endif | 633 #endif |
| 634 } | 634 } |
| 635 | 635 |
| 636 } // namespace browser_sync | 636 } // namespace browser_sync |
| OLD | NEW |