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