OLD | NEW |
| (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/omnibox/omnibox_api_factory.h" | |
6 | |
7 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | |
8 #include "chrome/browser/profiles/profile_dependency_manager.h" | |
9 | |
10 namespace extensions { | |
11 | |
12 // static | |
13 OmniboxAPI* OmniboxAPIFactory::GetForProfile(Profile* profile) { | |
14 return static_cast<OmniboxAPI*>( | |
15 GetInstance()->GetServiceForProfile(profile, true)); | |
16 } | |
17 | |
18 // static | |
19 OmniboxAPIFactory* OmniboxAPIFactory::GetInstance() { | |
20 return Singleton<OmniboxAPIFactory>::get(); | |
21 } | |
22 | |
23 OmniboxAPIFactory::OmniboxAPIFactory() | |
24 : ProfileKeyedServiceFactory("OmniboxAPI", | |
25 ProfileDependencyManager::GetInstance()) { | |
26 } | |
27 | |
28 OmniboxAPIFactory::~OmniboxAPIFactory() { | |
29 } | |
30 | |
31 ProfileKeyedService* OmniboxAPIFactory::BuildServiceInstanceFor( | |
32 Profile* profile) const { | |
33 return new OmniboxAPI(profile); | |
34 } | |
35 | |
36 bool OmniboxAPIFactory::ServiceIsCreatedWithProfile() const { | |
37 return true; | |
38 } | |
39 | |
40 bool OmniboxAPIFactory::ServiceRedirectedInIncognito() const { | |
41 return true; | |
42 } | |
43 | |
44 } // namespace extensions | |
OLD | NEW |