OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/passwords_private/passwords_private_dele
gate_factory.h" | 5 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele
gate_factory.h" |
6 | 6 |
7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele
gate_impl.h" | 8 #include "chrome/browser/extensions/api/passwords_private/passwords_private_dele
gate_impl.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
11 #include "extensions/browser/extension_system_provider.h" | 11 #include "extensions/browser/extension_system_provider.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 using content::BrowserContext; | 15 using content::BrowserContext; |
16 | 16 |
17 // static | 17 // static |
18 PasswordsPrivateDelegate* PasswordsPrivateDelegateFactory::GetForBrowserContext( | 18 PasswordsPrivateDelegate* PasswordsPrivateDelegateFactory::GetForBrowserContext( |
19 BrowserContext* browser_context, | 19 BrowserContext* browser_context, |
20 bool create) { | 20 bool create) { |
21 return static_cast<PasswordsPrivateDelegate*>( | 21 return static_cast<PasswordsPrivateDelegate*>( |
22 GetInstance()->GetServiceForBrowserContext(browser_context, create)); | 22 GetInstance()->GetServiceForBrowserContext(browser_context, create)); |
23 } | 23 } |
24 | 24 |
25 // static | 25 // static |
26 PasswordsPrivateDelegateFactory* | 26 PasswordsPrivateDelegateFactory* |
27 PasswordsPrivateDelegateFactory::GetInstance() { | 27 PasswordsPrivateDelegateFactory::GetInstance() { |
28 return Singleton<PasswordsPrivateDelegateFactory>::get(); | 28 return base::Singleton<PasswordsPrivateDelegateFactory>::get(); |
29 } | 29 } |
30 | 30 |
31 PasswordsPrivateDelegateFactory::PasswordsPrivateDelegateFactory() | 31 PasswordsPrivateDelegateFactory::PasswordsPrivateDelegateFactory() |
32 : BrowserContextKeyedServiceFactory( | 32 : BrowserContextKeyedServiceFactory( |
33 "PasswordsPrivateDelegate", | 33 "PasswordsPrivateDelegate", |
34 BrowserContextDependencyManager::GetInstance()) { | 34 BrowserContextDependencyManager::GetInstance()) { |
35 } | 35 } |
36 | 36 |
37 PasswordsPrivateDelegateFactory::~PasswordsPrivateDelegateFactory() { | 37 PasswordsPrivateDelegateFactory::~PasswordsPrivateDelegateFactory() { |
38 } | 38 } |
39 | 39 |
40 KeyedService* PasswordsPrivateDelegateFactory::BuildServiceInstanceFor( | 40 KeyedService* PasswordsPrivateDelegateFactory::BuildServiceInstanceFor( |
41 content::BrowserContext* profile) const { | 41 content::BrowserContext* profile) const { |
42 return new PasswordsPrivateDelegateImpl(static_cast<Profile*>(profile)); | 42 return new PasswordsPrivateDelegateImpl(static_cast<Profile*>(profile)); |
43 } | 43 } |
44 | 44 |
45 bool PasswordsPrivateDelegateFactory:: | 45 bool PasswordsPrivateDelegateFactory:: |
46 ServiceIsCreatedWithBrowserContext() const { | 46 ServiceIsCreatedWithBrowserContext() const { |
47 return false; | 47 return false; |
48 } | 48 } |
49 | 49 |
50 bool PasswordsPrivateDelegateFactory::ServiceIsNULLWhileTesting() const { | 50 bool PasswordsPrivateDelegateFactory::ServiceIsNULLWhileTesting() const { |
51 return false; | 51 return false; |
52 } | 52 } |
53 | 53 |
54 } // namespace extensions | 54 } // namespace extensions |
OLD | NEW |