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/ui/webui/signin/login_ui_service_factory.h" | 5 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 LoginUIServiceFactory::~LoginUIServiceFactory() {} | 21 LoginUIServiceFactory::~LoginUIServiceFactory() {} |
22 | 22 |
23 // static | 23 // static |
24 LoginUIService* LoginUIServiceFactory::GetForProfile(Profile* profile) { | 24 LoginUIService* LoginUIServiceFactory::GetForProfile(Profile* profile) { |
25 return static_cast<LoginUIService*>( | 25 return static_cast<LoginUIService*>( |
26 GetInstance()->GetServiceForBrowserContext(profile, true)); | 26 GetInstance()->GetServiceForBrowserContext(profile, true)); |
27 } | 27 } |
28 | 28 |
29 // static | 29 // static |
30 LoginUIServiceFactory* LoginUIServiceFactory::GetInstance() { | 30 LoginUIServiceFactory* LoginUIServiceFactory::GetInstance() { |
31 return Singleton<LoginUIServiceFactory>::get(); | 31 return base::Singleton<LoginUIServiceFactory>::get(); |
32 } | 32 } |
33 | 33 |
34 // static | 34 // static |
35 base::Closure LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile( | 35 base::Closure LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile( |
36 Profile* profile) { | 36 Profile* profile) { |
37 return base::Bind( | 37 return base::Bind( |
38 &LoginUIService::ShowLoginPopup, | 38 &LoginUIService::ShowLoginPopup, |
39 base::Unretained(LoginUIServiceFactory::GetForProfile(profile))); | 39 base::Unretained(LoginUIServiceFactory::GetForProfile(profile))); |
40 } | 40 } |
41 | 41 |
42 KeyedService* LoginUIServiceFactory::BuildServiceInstanceFor( | 42 KeyedService* LoginUIServiceFactory::BuildServiceInstanceFor( |
43 content::BrowserContext* profile) const { | 43 content::BrowserContext* profile) const { |
44 return new LoginUIService(static_cast<Profile*>(profile)); | 44 return new LoginUIService(static_cast<Profile*>(profile)); |
45 } | 45 } |
OLD | NEW |