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(GetRefreshToken(), scopes, "access_token", | 323 RegisterCacheEntry(GetRefreshToken(account_id), scopes, "access_token", |
323 base::Time::Max()); | 324 base::Time::Max()); |
324 return ProfileOAuth2TokenService::StartRequest(scopes, consumer); | 325 return ProfileOAuth2TokenService::StartRequest(account_id, scopes, consumer); |
325 } | 326 } |
326 | 327 |
327 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( | 328 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( |
328 content::BrowserContext* context) { | 329 content::BrowserContext* context) { |
329 Profile* profile = static_cast<Profile*>(context); | 330 Profile* profile = static_cast<Profile*>(context); |
330 | 331 |
331 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); | 332 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); |
332 service->Initialize(profile); | 333 service->Initialize(profile); |
333 return service; | 334 return service; |
334 } | 335 } |
OLD | NEW |