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/signin/chrome_signin_manager_delegate.h" | 9 #include "chrome/browser/signin/chrome_signin_client.h" |
10 #include "chrome/browser/signin/local_auth.h" | 10 #include "chrome/browser/signin/local_auth.h" |
11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
12 #include "chrome/browser/signin/signin_manager.h" | 12 #include "chrome/browser/signin/signin_manager.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 14 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
15 #include "components/user_prefs/pref_registry_syncable.h" | 15 #include "components/user_prefs/pref_registry_syncable.h" |
16 | 16 |
17 SigninManagerFactory::SigninManagerFactory() | 17 SigninManagerFactory::SigninManagerFactory() |
18 : BrowserContextKeyedServiceFactory( | 18 : BrowserContextKeyedServiceFactory( |
19 "SigninManager", | 19 "SigninManager", |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 BrowserContextKeyedService* SigninManagerFactory::BuildServiceInstanceFor( | 122 BrowserContextKeyedService* SigninManagerFactory::BuildServiceInstanceFor( |
123 content::BrowserContext* context) const { | 123 content::BrowserContext* context) const { |
124 SigninManagerBase* service = NULL; | 124 SigninManagerBase* service = NULL; |
125 Profile* profile = static_cast<Profile*>(context); | 125 Profile* profile = static_cast<Profile*>(context); |
126 #if defined(OS_CHROMEOS) | 126 #if defined(OS_CHROMEOS) |
127 service = new SigninManagerBase(); | 127 service = new SigninManagerBase(); |
128 #else | 128 #else |
129 service = new SigninManager( | 129 service = new SigninManager( |
130 scoped_ptr<SigninManagerDelegate>( | 130 scoped_ptr<SigninClient>(new ChromeSigninClient(profile))); |
131 new ChromeSigninManagerDelegate(profile))); | |
132 #endif | 131 #endif |
133 service->Initialize(profile, g_browser_process->local_state()); | 132 service->Initialize(profile, g_browser_process->local_state()); |
134 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerCreated(service)); | 133 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerCreated(service)); |
135 return service; | 134 return service; |
136 } | 135 } |
137 | 136 |
138 void SigninManagerFactory::BrowserContextShutdown( | 137 void SigninManagerFactory::BrowserContextShutdown( |
139 content::BrowserContext* context) { | 138 content::BrowserContext* context) { |
140 SigninManagerBase* manager = static_cast<SigninManagerBase*>( | 139 SigninManagerBase* manager = static_cast<SigninManagerBase*>( |
141 GetServiceForBrowserContext(context, false)); | 140 GetServiceForBrowserContext(context, false)); |
142 if (manager) | 141 if (manager) |
143 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerShutdown(manager)); | 142 FOR_EACH_OBSERVER(Observer, observer_list_, SigninManagerShutdown(manager)); |
144 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context); | 143 BrowserContextKeyedServiceFactory::BrowserContextShutdown(context); |
145 } | 144 } |
OLD | NEW |