Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Side by Side Diff: chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc

Issue 168253002: Cleanup many APIs to use ProfileKeyedAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api_fa ctory.h"
6
7 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h"
8 #include "chrome/browser/extensions/extension_system_factory.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "components/browser_context_keyed_service/browser_context_dependency_ma nager.h"
11 #include "extensions/browser/extensions_browser_client.h"
12
13 namespace extensions {
14
15 // static
16 AutotestPrivateAPI* AutotestPrivateAPIFactory::GetForProfile(Profile* profile) {
17 return static_cast<AutotestPrivateAPI*>(GetInstance()->
18 GetServiceForBrowserContext(profile, true));
19 }
20
21 // static
22 AutotestPrivateAPIFactory* AutotestPrivateAPIFactory::GetInstance() {
23 return Singleton<AutotestPrivateAPIFactory>::get();
24 }
25
26 AutotestPrivateAPIFactory::AutotestPrivateAPIFactory()
27 : BrowserContextKeyedServiceFactory(
28 "AutotestPrivateAPI",
29 BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(ExtensionSystemFactory::GetInstance());
31 }
32
33 AutotestPrivateAPIFactory::~AutotestPrivateAPIFactory() {
34 }
35
36 BrowserContextKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor(
37 content::BrowserContext* profile) const {
38 return new AutotestPrivateAPI();
39 }
40
41 content::BrowserContext* AutotestPrivateAPIFactory::GetBrowserContextToUse(
42 content::BrowserContext* context) const {
43 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
44 }
45
46 bool AutotestPrivateAPIFactory::ServiceIsCreatedWithBrowserContext() const {
47 return true;
48 }
49
50 bool AutotestPrivateAPIFactory::ServiceIsNULLWhileTesting() const {
51 return true;
52 }
53
54 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698