| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/signin/oauth2_token_service_factory.h" | 5 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "components/keyed_service/ios/browser_state_dependency_manager.h" | 9 #include "components/keyed_service/ios/browser_state_dependency_manager.h" |
| 10 #include "components/pref_registry/pref_registry_syncable.h" | 10 #include "components/pref_registry/pref_registry_syncable.h" |
| 11 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 11 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 12 #include "components/signin/core/common/signin_pref_names.h" | 12 #include "components/signin/core/common/signin_pref_names.h" |
| 13 #include "components/signin/ios/browser/profile_oauth2_token_service_ios_delegat
e.h" | 13 #include "components/signin/ios/browser/profile_oauth2_token_service_ios_delegat
e.h" |
| 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 14 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 15 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" | 15 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" |
| 16 #include "ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_im
pl.h" | 16 #include "ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_im
pl.h" |
| 17 #include "ios/chrome/browser/signin/signin_client_factory.h" | 17 #include "ios/chrome/browser/signin/signin_client_factory.h" |
| 18 #include "ios/chrome/browser/signin/signin_error_controller_factory.h" | 18 #include "ios/chrome/browser/signin/signin_error_controller_factory.h" |
| 19 | 19 |
| 20 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 21 #error "This file requires ARC support." |
| 22 #endif |
| 23 |
| 20 OAuth2TokenServiceFactory::OAuth2TokenServiceFactory() | 24 OAuth2TokenServiceFactory::OAuth2TokenServiceFactory() |
| 21 : BrowserStateKeyedServiceFactory( | 25 : BrowserStateKeyedServiceFactory( |
| 22 "ProfileOAuth2TokenService", | 26 "ProfileOAuth2TokenService", |
| 23 BrowserStateDependencyManager::GetInstance()) { | 27 BrowserStateDependencyManager::GetInstance()) { |
| 24 DependsOn(ios::AccountTrackerServiceFactory::GetInstance()); | 28 DependsOn(ios::AccountTrackerServiceFactory::GetInstance()); |
| 25 DependsOn(SigninClientFactory::GetInstance()); | 29 DependsOn(SigninClientFactory::GetInstance()); |
| 26 DependsOn(ios::SigninErrorControllerFactory::GetInstance()); | 30 DependsOn(ios::SigninErrorControllerFactory::GetInstance()); |
| 27 } | 31 } |
| 28 | 32 |
| 29 OAuth2TokenServiceFactory::~OAuth2TokenServiceFactory() {} | 33 OAuth2TokenServiceFactory::~OAuth2TokenServiceFactory() {} |
| (...skipping 23 matching lines...) Expand all Loading... |
| 53 ios::ChromeBrowserState::FromBrowserState(context); | 57 ios::ChromeBrowserState::FromBrowserState(context); |
| 54 auto delegate = base::MakeUnique<ProfileOAuth2TokenServiceIOSDelegate>( | 58 auto delegate = base::MakeUnique<ProfileOAuth2TokenServiceIOSDelegate>( |
| 55 SigninClientFactory::GetForBrowserState(chrome_browser_state), | 59 SigninClientFactory::GetForBrowserState(chrome_browser_state), |
| 56 base::MakeUnique<ProfileOAuth2TokenServiceIOSProviderImpl>(), | 60 base::MakeUnique<ProfileOAuth2TokenServiceIOSProviderImpl>(), |
| 57 ios::AccountTrackerServiceFactory::GetForBrowserState( | 61 ios::AccountTrackerServiceFactory::GetForBrowserState( |
| 58 chrome_browser_state), | 62 chrome_browser_state), |
| 59 ios::SigninErrorControllerFactory::GetForBrowserState( | 63 ios::SigninErrorControllerFactory::GetForBrowserState( |
| 60 chrome_browser_state)); | 64 chrome_browser_state)); |
| 61 return base::MakeUnique<ProfileOAuth2TokenService>(std::move(delegate)); | 65 return base::MakeUnique<ProfileOAuth2TokenService>(std::move(delegate)); |
| 62 } | 66 } |
| OLD | NEW |