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/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" | 5 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api_fa
ctory.h" |
6 | 6 |
7 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" | 7 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" |
8 #include "chrome/browser/extensions/extension_system_factory.h" | 8 #include "chrome/browser/extensions/extension_system_factory.h" |
9 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 11 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 // static | 15 // static |
16 AutotestPrivateAPI* AutotestPrivateAPIFactory::GetForProfile(Profile* profile) { | 16 AutotestPrivateAPI* AutotestPrivateAPIFactory::GetForProfile(Profile* profile) { |
17 return static_cast<AutotestPrivateAPI*>(GetInstance()-> | 17 return static_cast<AutotestPrivateAPI*>(GetInstance()-> |
18 GetServiceForProfile(profile, true)); | 18 GetServiceForBrowserContext(profile, true)); |
19 } | 19 } |
20 | 20 |
21 // static | 21 // static |
22 AutotestPrivateAPIFactory* AutotestPrivateAPIFactory::GetInstance() { | 22 AutotestPrivateAPIFactory* AutotestPrivateAPIFactory::GetInstance() { |
23 return Singleton<AutotestPrivateAPIFactory>::get(); | 23 return Singleton<AutotestPrivateAPIFactory>::get(); |
24 } | 24 } |
25 | 25 |
26 AutotestPrivateAPIFactory::AutotestPrivateAPIFactory() | 26 AutotestPrivateAPIFactory::AutotestPrivateAPIFactory() |
27 : ProfileKeyedServiceFactory("AutotestPrivateAPI", | 27 : BrowserContextKeyedServiceFactory( |
28 ProfileDependencyManager::GetInstance()) { | 28 "AutotestPrivateAPI", |
| 29 BrowserContextDependencyManager::GetInstance()) { |
29 DependsOn(ExtensionSystemFactory::GetInstance()); | 30 DependsOn(ExtensionSystemFactory::GetInstance()); |
30 } | 31 } |
31 | 32 |
32 AutotestPrivateAPIFactory::~AutotestPrivateAPIFactory() { | 33 AutotestPrivateAPIFactory::~AutotestPrivateAPIFactory() { |
33 } | 34 } |
34 | 35 |
35 ProfileKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor( | 36 BrowserContextKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor( |
36 content::BrowserContext* profile) const { | 37 content::BrowserContext* profile) const { |
37 return new AutotestPrivateAPI(); | 38 return new AutotestPrivateAPI(); |
38 } | 39 } |
39 | 40 |
40 content::BrowserContext* AutotestPrivateAPIFactory::GetBrowserContextToUse( | 41 content::BrowserContext* AutotestPrivateAPIFactory::GetBrowserContextToUse( |
41 content::BrowserContext* context) const { | 42 content::BrowserContext* context) const { |
42 return chrome::GetBrowserContextRedirectedInIncognito(context); | 43 return chrome::GetBrowserContextRedirectedInIncognito(context); |
43 } | 44 } |
44 | 45 |
45 bool AutotestPrivateAPIFactory::ServiceIsCreatedWithProfile() const { | 46 bool AutotestPrivateAPIFactory::ServiceIsCreatedWithBrowserContext() const { |
46 return true; | 47 return true; |
47 } | 48 } |
48 | 49 |
49 bool AutotestPrivateAPIFactory::ServiceIsNULLWhileTesting() const { | 50 bool AutotestPrivateAPIFactory::ServiceIsNULLWhileTesting() const { |
50 return true; | 51 return true; |
51 } | 52 } |
52 | 53 |
53 } // namespace extensions | 54 } // namespace extensions |
OLD | NEW |