OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |