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

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

Issue 2685123002: Make OAuth2TokenService and subclasses take delegate by unique_ptr (Closed)
Patch Set: Created 3 years, 10 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"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 registry->RegisterBooleanPref(prefs::kTokenServiceExcludeAllSecondaryAccounts, 44 registry->RegisterBooleanPref(prefs::kTokenServiceExcludeAllSecondaryAccounts,
45 false); 45 false);
46 registry->RegisterListPref(prefs::kTokenServiceExcludedSecondaryAccounts); 46 registry->RegisterListPref(prefs::kTokenServiceExcludedSecondaryAccounts);
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 auto delegate = base::MakeUnique<ProfileOAuth2TokenServiceIOSDelegate>(
55 new ProfileOAuth2TokenServiceIOSDelegate( 55 SigninClientFactory::GetForBrowserState(chrome_browser_state),
56 SigninClientFactory::GetForBrowserState(chrome_browser_state), 56 base::MakeUnique<ProfileOAuth2TokenServiceIOSProviderImpl>(),
57 base::MakeUnique<ProfileOAuth2TokenServiceIOSProviderImpl>(), 57 ios::AccountTrackerServiceFactory::GetForBrowserState(
58 ios::AccountTrackerServiceFactory::GetForBrowserState( 58 chrome_browser_state),
59 chrome_browser_state), 59 ios::SigninErrorControllerFactory::GetForBrowserState(
60 ios::SigninErrorControllerFactory::GetForBrowserState( 60 chrome_browser_state));
61 chrome_browser_state)); 61 return base::MakeUnique<ProfileOAuth2TokenService>(std::move(delegate));
62 return base::WrapUnique(new ProfileOAuth2TokenService(delegate));
63 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698