| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 6 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
| 7 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" | 7 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" |
| 8 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" | 8 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" |
| 9 #include "chrome/browser/signin/signin_error_controller_factory.h" | 9 #include "chrome/browser/signin/signin_error_controller_factory.h" |
| 10 | 10 |
| 11 // TODO(blundell): Should these be namespaced? | 11 // TODO(blundell): Should these be namespaced? |
| 12 KeyedService* BuildFakeProfileOAuth2TokenService( | 12 KeyedService* BuildFakeProfileOAuth2TokenService( |
| 13 content::BrowserContext* context) { | 13 content::BrowserContext* context) { |
| 14 Profile* profile = Profile::FromBrowserContext(context); | 14 // Profile* profile = Profile::FromBrowserContext(context); |
| 15 FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); | 15 FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); |
| 16 service->Initialize( | 16 // service->Initialize( |
| 17 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile), | 17 // ChromeSigninClientFactory::GetInstance()->GetForProfile(profile), |
| 18 SigninErrorControllerFactory::GetInstance()->GetForProfile(profile)); | 18 // SigninErrorControllerFactory::GetInstance()->GetForProfile(profile)); |
| 19 return service; | 19 return service; |
| 20 } | 20 } |
| 21 | 21 |
| 22 KeyedService* BuildAutoIssuingFakeProfileOAuth2TokenService( | 22 KeyedService* BuildAutoIssuingFakeProfileOAuth2TokenService( |
| 23 content::BrowserContext* context) { | 23 content::BrowserContext* context) { |
| 24 Profile* profile = Profile::FromBrowserContext(context); | 24 // Profile* profile = Profile::FromBrowserContext(context); |
| 25 FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); | 25 FakeProfileOAuth2TokenService* service = new FakeProfileOAuth2TokenService(); |
| 26 service->set_auto_post_fetch_response_on_message_loop(true); | 26 // service->set_auto_post_fetch_response_on_message_loop(true); |
| 27 service->Initialize( | 27 // service->Initialize( |
| 28 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile), | 28 // ChromeSigninClientFactory::GetInstance()->GetForProfile(profile), |
| 29 SigninErrorControllerFactory::GetInstance()->GetForProfile(profile)); | 29 // |
| 30 // SigninErrorControllerFactory::GetInstance()->GetForProfile(profile)); |
| 30 return service; | 31 return service; |
| 31 } | 32 } |
| OLD | NEW |