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