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

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

Issue 216493003: Abstract most Profile knowledge from SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix after rebase Created 6 years, 9 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/signin_manager_factory.h" 5 #include "chrome/browser/signin/signin_manager_factory.h"
6 6
7 #include "base/prefs/pref_registry_simple.h" 7 #include "base/prefs/pref_registry_simple.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/signin/chrome_signin_client_factory.h" 10 #include "chrome/browser/signin/chrome_signin_client_factory.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 123
124 KeyedService* SigninManagerFactory::BuildServiceInstanceFor( 124 KeyedService* SigninManagerFactory::BuildServiceInstanceFor(
125 content::BrowserContext* context) const { 125 content::BrowserContext* context) const {
126 SigninManagerBase* service = NULL; 126 SigninManagerBase* service = NULL;
127 Profile* profile = static_cast<Profile*>(context); 127 Profile* profile = static_cast<Profile*>(context);
128 SigninClient* client = 128 SigninClient* client =
129 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile); 129 ChromeSigninClientFactory::GetInstance()->GetForProfile(profile);
130 #if defined(OS_CHROMEOS) 130 #if defined(OS_CHROMEOS)
131 service = new SigninManagerBase(client); 131 service = new SigninManagerBase(client);
132 #else 132 #else
133 service = new SigninManager(client); 133 service = new SigninManager(
134 client, ProfileOAuth2TokenServiceFactory::GetForProfile(profile));
134 #endif 135 #endif
135 service->Initialize(profile, g_browser_process->local_state()); 136 service->Initialize(profile, g_browser_process->local_state());
136 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerCreated(service)); 137 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerCreated(service));
137 return service; 138 return service;
138 } 139 }
139 140
140 void SigninManagerFactory::BrowserContextShutdown( 141 void SigninManagerFactory::BrowserContextShutdown(
141 content::BrowserContext* context) { 142 content::BrowserContext* context) {
142 SigninManagerBase* manager = static_cast<SigninManagerBase*>( 143 SigninManagerBase* manager = static_cast<SigninManagerBase*>(
143 GetServiceForBrowserContext(context, false)); 144 GetServiceForBrowserContext(context, false));
144 if (manager) 145 if (manager)
145 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerShutdown(manager)); 146 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerShutdown(manager));
146 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context); 147 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context);
147 } 148 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_manager.cc ('k') | chrome/browser/signin/signin_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698