| 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/test_profile_sync_service.h" | 5 #include "chrome/browser/sync/test_profile_sync_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/signin/signin_manager.h" | 7 #include "chrome/browser/signin/signin_manager.h" |
| 8 #include "chrome/browser/signin/signin_manager_factory.h" | 8 #include "chrome/browser/signin/signin_manager_factory.h" |
| 9 #include "chrome/browser/sync/glue/data_type_controller.h" | 9 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 10 #include "chrome/browser/sync/glue/sync_backend_host.h" | 10 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 browser_sync::SyncBackendHostForProfileSyncTest* | 201 browser_sync::SyncBackendHostForProfileSyncTest* |
| 202 TestProfileSyncService::GetBackendForTest() { | 202 TestProfileSyncService::GetBackendForTest() { |
| 203 return static_cast<browser_sync::SyncBackendHostForProfileSyncTest*>( | 203 return static_cast<browser_sync::SyncBackendHostForProfileSyncTest*>( |
| 204 ProfileSyncService::GetBackendForTest()); | 204 ProfileSyncService::GetBackendForTest()); |
| 205 } | 205 } |
| 206 | 206 |
| 207 TestProfileSyncService::TestProfileSyncService( | 207 TestProfileSyncService::TestProfileSyncService( |
| 208 ProfileSyncComponentsFactory* factory, | 208 ProfileSyncComponentsFactory* factory, |
| 209 Profile* profile, | 209 Profile* profile, |
| 210 SigninManager* signin, | 210 SigninManagerBase* signin, |
| 211 ProfileSyncService::StartBehavior behavior, | 211 ProfileSyncService::StartBehavior behavior, |
| 212 bool synchronous_backend_initialization) | 212 bool synchronous_backend_initialization) |
| 213 : ProfileSyncService(factory, | 213 : ProfileSyncService(factory, |
| 214 profile, | 214 profile, |
| 215 signin, | 215 signin, |
| 216 behavior), | 216 behavior), |
| 217 synchronous_backend_initialization_( | 217 synchronous_backend_initialization_( |
| 218 synchronous_backend_initialization), | 218 synchronous_backend_initialization), |
| 219 synchronous_sync_configuration_(false), | 219 synchronous_sync_configuration_(false), |
| 220 set_initial_sync_ended_on_init_(true), | 220 set_initial_sync_ended_on_init_(true), |
| 221 fail_initial_download_(false), | 221 fail_initial_download_(false), |
| 222 storage_option_(syncer::STORAGE_IN_MEMORY) { | 222 storage_option_(syncer::STORAGE_IN_MEMORY) { |
| 223 SetSyncSetupCompleted(); | 223 SetSyncSetupCompleted(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 TestProfileSyncService::~TestProfileSyncService() { | 226 TestProfileSyncService::~TestProfileSyncService() { |
| 227 } | 227 } |
| 228 | 228 |
| 229 // static | 229 // static |
| 230 ProfileKeyedService* TestProfileSyncService::BuildAutoStartAsyncInit( | 230 ProfileKeyedService* TestProfileSyncService::BuildAutoStartAsyncInit( |
| 231 Profile* profile) { | 231 Profile* profile) { |
| 232 SigninManager* signin = SigninManagerFactory::GetForProfile(profile); | 232 SigninManagerBase* signin = |
| 233 SigninManagerFactory::GetForProfile(profile); |
| 233 ProfileSyncComponentsFactoryMock* factory = | 234 ProfileSyncComponentsFactoryMock* factory = |
| 234 new ProfileSyncComponentsFactoryMock(); | 235 new ProfileSyncComponentsFactoryMock(); |
| 235 return new TestProfileSyncService( | 236 return new TestProfileSyncService( |
| 236 factory, profile, signin, ProfileSyncService::AUTO_START, false); | 237 factory, profile, signin, ProfileSyncService::AUTO_START, false); |
| 237 } | 238 } |
| 238 | 239 |
| 239 ProfileSyncComponentsFactoryMock* | 240 ProfileSyncComponentsFactoryMock* |
| 240 TestProfileSyncService::components_factory_mock() { | 241 TestProfileSyncService::components_factory_mock() { |
| 241 // We always create a mock factory, see Build* routines. | 242 // We always create a mock factory, see Build* routines. |
| 242 return static_cast<ProfileSyncComponentsFactoryMock*>(factory()); | 243 return static_cast<ProfileSyncComponentsFactoryMock*>(factory()); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 profile(), | 288 profile(), |
| 288 sync_prefs_.AsWeakPtr(), | 289 sync_prefs_.AsWeakPtr(), |
| 289 invalidator_storage_.AsWeakPtr(), | 290 invalidator_storage_.AsWeakPtr(), |
| 290 id_factory_, | 291 id_factory_, |
| 291 callback_, | 292 callback_, |
| 292 set_initial_sync_ended_on_init_, | 293 set_initial_sync_ended_on_init_, |
| 293 synchronous_backend_initialization_, | 294 synchronous_backend_initialization_, |
| 294 fail_initial_download_, | 295 fail_initial_download_, |
| 295 storage_option_)); | 296 storage_option_)); |
| 296 } | 297 } |
| OLD | NEW |