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

Side by Side Diff: chrome/browser/signin/profile_oauth2_token_service_factory.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
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 "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/profiles/profile_dependency_manager.h" 8 #include "chrome/browser/profiles/profile_dependency_manager.h"
9 #include "chrome/browser/signin/profile_oauth2_token_service.h" 9 #include "chrome/browser/signin/profile_oauth2_token_service.h"
10 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
(...skipping 20 matching lines...) Expand all
31 GetInstance()->GetServiceForProfile(profile, true)); 31 GetInstance()->GetServiceForProfile(profile, true));
32 } 32 }
33 33
34 // static 34 // static
35 ProfileOAuth2TokenServiceFactory* 35 ProfileOAuth2TokenServiceFactory*
36 ProfileOAuth2TokenServiceFactory::GetInstance() { 36 ProfileOAuth2TokenServiceFactory::GetInstance() {
37 return Singleton<ProfileOAuth2TokenServiceFactory>::get(); 37 return Singleton<ProfileOAuth2TokenServiceFactory>::get();
38 } 38 }
39 39
40 ProfileKeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor( 40 ProfileKeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor(
41 Profile* profile) const { 41 content::BrowserContext* context) const {
42 Profile* profile = static_cast<Profile*>(context);
42 ProfileOAuth2TokenService* service; 43 ProfileOAuth2TokenService* service;
43 #if defined(OS_ANDROID) 44 #if defined(OS_ANDROID)
44 service = new AndroidProfileOAuth2TokenService(profile->GetRequestContext()); 45 service = new AndroidProfileOAuth2TokenService(profile->GetRequestContext());
45 #else 46 #else
46 service = new ProfileOAuth2TokenService(profile->GetRequestContext()); 47 service = new ProfileOAuth2TokenService(profile->GetRequestContext());
47 #endif 48 #endif
48 service->Initialize(profile); 49 service->Initialize(profile);
49 return service; 50 return service;
50 } 51 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698