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/extension_system_factory.h" | |
6 #include "chrome/browser/intents/web_intents_registry.h" | 5 #include "chrome/browser/intents/web_intents_registry.h" |
7 #include "chrome/browser/intents/web_intents_registry_factory.h" | 6 #include "chrome/browser/intents/web_intents_registry_factory.h" |
8 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/profiles/profile_dependency_manager.h" | 8 #include "chrome/browser/profiles/profile_dependency_manager.h" |
10 | 9 |
11 // static | 10 // static |
12 WebIntentsRegistry* WebIntentsRegistryFactory::GetForProfile(Profile* profile) { | 11 WebIntentsRegistry* WebIntentsRegistryFactory::GetForProfile(Profile* profile) { |
13 return static_cast<WebIntentsRegistry*>( | 12 return static_cast<WebIntentsRegistry*>( |
14 GetInstance()->GetServiceForProfile(profile, true)); | 13 GetInstance()->GetServiceForProfile(profile, true)); |
15 } | 14 } |
16 | 15 |
17 WebIntentsRegistryFactory::WebIntentsRegistryFactory() | 16 WebIntentsRegistryFactory::WebIntentsRegistryFactory() |
18 : ProfileKeyedServiceFactory("WebIntentsRegistry", | 17 : ProfileKeyedServiceFactory("WebIntentsRegistry", |
19 ProfileDependencyManager::GetInstance()) { | 18 ProfileDependencyManager::GetInstance()) { |
20 // TODO(erg): For Shutdown() order, we need to: | 19 // TODO(erg): For Shutdown() order, we need to: |
21 // DependsOn(WebDataServiceFactory::GetInstance()); | 20 // DependsOn(WebDataServiceFactory::GetInstance()); |
22 DependsOn(ExtensionSystemFactory::GetInstance()); | 21 // DependsOn(ExtensionServiceFactory::GetInstance()); |
23 } | 22 } |
24 | 23 |
25 WebIntentsRegistryFactory::~WebIntentsRegistryFactory() { | 24 WebIntentsRegistryFactory::~WebIntentsRegistryFactory() { |
26 } | 25 } |
27 | 26 |
28 // static | 27 // static |
29 WebIntentsRegistryFactory* WebIntentsRegistryFactory::GetInstance() { | 28 WebIntentsRegistryFactory* WebIntentsRegistryFactory::GetInstance() { |
30 return Singleton<WebIntentsRegistryFactory>::get(); | 29 return Singleton<WebIntentsRegistryFactory>::get(); |
31 } | 30 } |
32 | 31 |
33 ProfileKeyedService* WebIntentsRegistryFactory::BuildServiceInstanceFor( | 32 ProfileKeyedService* WebIntentsRegistryFactory::BuildServiceInstanceFor( |
34 Profile* profile) const { | 33 Profile* profile) const { |
35 WebIntentsRegistry* registry = new WebIntentsRegistry; | 34 WebIntentsRegistry* registry = new WebIntentsRegistry; |
36 registry->Initialize(profile->GetWebDataService(Profile::EXPLICIT_ACCESS), | 35 registry->Initialize(profile->GetWebDataService(Profile::EXPLICIT_ACCESS), |
37 profile->GetExtensionService()); | 36 profile->GetExtensionService()); |
38 return registry; | 37 return registry; |
39 } | 38 } |
40 | 39 |
41 bool WebIntentsRegistryFactory::ServiceRedirectedInIncognito() { | 40 bool WebIntentsRegistryFactory::ServiceRedirectedInIncognito() { |
42 return false; | 41 return false; |
43 } | 42 } |
OLD | NEW |