| 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 "chrome/browser/sync/profile_sync_service_factory.h" | 5 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 init_params.sync_client = | 173 init_params.sync_client = |
| 174 base::WrapUnique(new browser_sync::ChromeSyncClient(profile)); | 174 base::WrapUnique(new browser_sync::ChromeSyncClient(profile)); |
| 175 | 175 |
| 176 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); | 176 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); |
| 177 init_params.base_directory = profile->GetPath(); | 177 init_params.base_directory = profile->GetPath(); |
| 178 init_params.url_request_context = profile->GetRequestContext(); | 178 init_params.url_request_context = profile->GetRequestContext(); |
| 179 init_params.debug_identifier = profile->GetDebugName(); | 179 init_params.debug_identifier = profile->GetDebugName(); |
| 180 init_params.channel = chrome::GetChannel(); | 180 init_params.channel = chrome::GetChannel(); |
| 181 | 181 |
| 182 init_params.db_thread = content::BrowserThread::GetMessageLoopProxyForThread( | 182 init_params.db_thread = content::BrowserThread::GetTaskRunnerForThread( |
| 183 content::BrowserThread::DB); | 183 content::BrowserThread::DB); |
| 184 init_params.file_thread = | 184 init_params.file_thread = content::BrowserThread::GetTaskRunnerForThread( |
| 185 content::BrowserThread::GetMessageLoopProxyForThread( | 185 content::BrowserThread::FILE); |
| 186 content::BrowserThread::FILE); | |
| 187 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); | 186 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); |
| 188 | 187 |
| 189 auto pss = base::WrapUnique(new ProfileSyncService(std::move(init_params))); | 188 auto pss = base::WrapUnique(new ProfileSyncService(std::move(init_params))); |
| 190 | 189 |
| 191 // Will also initialize the sync client. | 190 // Will also initialize the sync client. |
| 192 pss->Initialize(); | 191 pss->Initialize(); |
| 193 return pss.release(); | 192 return pss.release(); |
| 194 } | 193 } |
| 195 | 194 |
| 196 // static | 195 // static |
| 197 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 196 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
| 198 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; | 197 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; |
| 199 } | 198 } |
| OLD | NEW |