Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: ios/chrome/browser/signin/oauth2_token_service_factory.mm

Issue 2121083004: Upstream ProfileOAuth2TokenServiceProviderImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/signin_client_factory.h" 17 #include "ios/chrome/browser/signin/signin_client_factory.h"
17 #include "ios/chrome/browser/signin/signin_error_controller_factory.h" 18 #include "ios/chrome/browser/signin/signin_error_controller_factory.h"
18 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
19 19
20 OAuth2TokenServiceFactory::OAuth2TokenServiceFactory() 20 OAuth2TokenServiceFactory::OAuth2TokenServiceFactory()
21 : BrowserStateKeyedServiceFactory( 21 : BrowserStateKeyedServiceFactory(
22 "ProfileOAuth2TokenService", 22 "ProfileOAuth2TokenService",
23 BrowserStateDependencyManager::GetInstance()) { 23 BrowserStateDependencyManager::GetInstance()) {
24 DependsOn(ios::AccountTrackerServiceFactory::GetInstance()); 24 DependsOn(ios::AccountTrackerServiceFactory::GetInstance());
25 DependsOn(SigninClientFactory::GetInstance()); 25 DependsOn(SigninClientFactory::GetInstance());
26 DependsOn(ios::SigninErrorControllerFactory::GetInstance()); 26 DependsOn(ios::SigninErrorControllerFactory::GetInstance());
27 } 27 }
28 28
(...skipping 18 matching lines...) Expand all
47 } 47 }
48 48
49 std::unique_ptr<KeyedService> 49 std::unique_ptr<KeyedService>
50 OAuth2TokenServiceFactory::BuildServiceInstanceFor( 50 OAuth2TokenServiceFactory::BuildServiceInstanceFor(
51 web::BrowserState* context) const { 51 web::BrowserState* context) const {
52 ios::ChromeBrowserState* chrome_browser_state = 52 ios::ChromeBrowserState* chrome_browser_state =
53 ios::ChromeBrowserState::FromBrowserState(context); 53 ios::ChromeBrowserState::FromBrowserState(context);
54 ProfileOAuth2TokenServiceIOSDelegate* delegate = 54 ProfileOAuth2TokenServiceIOSDelegate* delegate =
55 new ProfileOAuth2TokenServiceIOSDelegate( 55 new ProfileOAuth2TokenServiceIOSDelegate(
56 SigninClientFactory::GetForBrowserState(chrome_browser_state), 56 SigninClientFactory::GetForBrowserState(chrome_browser_state),
57 ios::GetChromeBrowserProvider() 57 base::WrapUnique(new ProfileOAuth2TokenServiceIOSProviderImpl()),
sdefresne 2016/07/06 08:43:28 ditto, base::MakeUnique<ProfileOAuth2TokenServiceI
bzanotti 2016/07/06 11:02:21 Done.
58 ->GetProfileOAuth2TokenServiceIOSProvider(),
59 ios::AccountTrackerServiceFactory::GetForBrowserState( 58 ios::AccountTrackerServiceFactory::GetForBrowserState(
60 chrome_browser_state), 59 chrome_browser_state),
61 ios::SigninErrorControllerFactory::GetForBrowserState( 60 ios::SigninErrorControllerFactory::GetForBrowserState(
62 chrome_browser_state)); 61 chrome_browser_state));
63 return base::WrapUnique(new ProfileOAuth2TokenService(delegate)); 62 return base::WrapUnique(new ProfileOAuth2TokenService(delegate));
64 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698