| 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/signin/profile_oauth2_token_service_factory.h" | 5 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/signin/account_tracker_service_factory.h" | 9 #include "chrome/browser/signin/account_tracker_service_factory.h" |
| 10 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 10 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // static | 45 // static |
| 46 ProfileOAuth2TokenServiceFactory* | 46 ProfileOAuth2TokenServiceFactory* |
| 47 ProfileOAuth2TokenServiceFactory::GetInstance() { | 47 ProfileOAuth2TokenServiceFactory::GetInstance() { |
| 48 return base::Singleton<ProfileOAuth2TokenServiceFactory>::get(); | 48 return base::Singleton<ProfileOAuth2TokenServiceFactory>::get(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 KeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor( | 51 KeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor( |
| 52 content::BrowserContext* context) const { | 52 content::BrowserContext* context) const { |
| 53 Profile* profile = static_cast<Profile*>(context); | 53 Profile* profile = static_cast<Profile*>(context); |
| 54 #if defined(OS_ANDROID) | 54 #if defined(OS_ANDROID) |
| 55 OAuth2TokenServiceDelegateAndroid* delegate = | 55 auto delegate = base::MakeUnique<OAuth2TokenServiceDelegateAndroid>( |
| 56 new OAuth2TokenServiceDelegateAndroid( | 56 AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile)); |
| 57 AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile)); | |
| 58 #else | 57 #else |
| 59 MutableProfileOAuth2TokenServiceDelegate* delegate = | 58 auto delegate = base::MakeUnique<MutableProfileOAuth2TokenServiceDelegate>( |
| 60 new MutableProfileOAuth2TokenServiceDelegate( | 59 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile), |
| 61 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile), | 60 SigninErrorControllerFactory::GetInstance()->GetForProfile(profile), |
| 62 SigninErrorControllerFactory::GetInstance()->GetForProfile(profile), | 61 AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile)); |
| 63 AccountTrackerServiceFactory::GetInstance()->GetForProfile(profile)); | |
| 64 #endif | 62 #endif |
| 65 ProfileOAuth2TokenService* service = new ProfileOAuth2TokenService(delegate); | 63 ProfileOAuth2TokenService* service = |
| 64 new ProfileOAuth2TokenService(std::move(delegate)); |
| 66 return service; | 65 return service; |
| 67 } | 66 } |
| OLD | NEW |