| 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/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/signin/signin_manager.h" | 8 #include "chrome/browser/signin/signin_manager.h" |
| 9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
| 10 #include "chrome/browser/sync/glue/data_type_controller.h" | 10 #include "chrome/browser/sync/glue/data_type_controller.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 sync_prefs_.AsWeakPtr(), | 308 sync_prefs_.AsWeakPtr(), |
| 309 id_factory_, | 309 id_factory_, |
| 310 callback_, | 310 callback_, |
| 311 set_initial_sync_ended_on_init_, | 311 set_initial_sync_ended_on_init_, |
| 312 synchronous_backend_initialization_, | 312 synchronous_backend_initialization_, |
| 313 fail_initial_download_, | 313 fail_initial_download_, |
| 314 storage_option_)); | 314 storage_option_)); |
| 315 } | 315 } |
| 316 | 316 |
| 317 scoped_ptr<OAuth2TokenService::Request> FakeOAuth2TokenService::StartRequest( | 317 scoped_ptr<OAuth2TokenService::Request> FakeOAuth2TokenService::StartRequest( |
| 318 const std::string& account_id, |
| 318 const OAuth2TokenService::ScopeSet& scopes, | 319 const OAuth2TokenService::ScopeSet& scopes, |
| 319 OAuth2TokenService::Consumer* consumer) { | 320 OAuth2TokenService::Consumer* consumer) { |
| 320 // Ensure token in question is cached and never expires. Request will succeed | 321 // Ensure token in question is cached and never expires. Request will succeed |
| 321 // without network IO. | 322 // without network IO. |
| 322 RegisterCacheEntry("test_client_id", | 323 RegisterCacheEntry("test_client_id", |
| 323 GetRefreshToken(), | 324 GetRefreshToken(account_id), |
| 324 scopes, | 325 scopes, |
| 325 "access_token", | 326 "access_token", |
| 326 base::Time::Max()); | 327 base::Time::Max()); |
| 327 return ProfileOAuth2TokenService::StartRequest(scopes, consumer); | 328 return ProfileOAuth2TokenService::StartRequest(account_id, scopes, consumer); |
| 328 } | 329 } |
| 329 | 330 |
| 330 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( | 331 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( |
| 331 content::BrowserContext* context) { | 332 content::BrowserContext* context) { |
| 332 Profile* profile = static_cast<Profile*>(context); | 333 Profile* profile = static_cast<Profile*>(context); |
| 333 | 334 |
| 334 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); | 335 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); |
| 335 service->Initialize(profile); | 336 service->Initialize(profile); |
| 336 return service; | 337 return service; |
| 337 } | 338 } |
| 339 |
| 340 void FakeOAuth2TokenService::PersistCredentials( |
| 341 const std::string& account_id, |
| 342 const std::string& refresh_token) { |
| 343 // Disabling the token persistence. |
| 344 } |
| 345 |
| 346 void FakeOAuth2TokenService::ClearPersistedCredentials( |
| 347 const std::string& account_id) { |
| 348 // Disabling the token persistence. |
| 349 } |
| OLD | NEW |