Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 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/intents/web_intents_registry.h" | |
| 6 #include "chrome/browser/intents/web_intents_registry_factory.h" | |
| 7 #include "chrome/browser/profiles/profile.h" | |
| 8 #include "chrome/browser/profiles/profile_dependency_manager.h" | |
| 9 | |
| 10 // static | |
| 11 WebIntentsRegistry* WebIntentsRegistryFactory::GetForProfile(Profile* profile) { | |
| 12 return static_cast<WebIntentsRegistry*>( | |
| 13 GetInstance()->GetServiceForProfile(profile, true)); | |
| 14 } | |
| 15 | |
| 16 WebIntentsRegistryFactory::WebIntentsRegistryFactory() | |
| 17 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { | |
|
Elliot Glaysher
2011/08/10 17:47:54
nit: Please add the following comment to remind me
James Hawkins
2011/08/11 20:49:07
Done.
| |
| 18 } | |
| 19 | |
| 20 WebIntentsRegistryFactory::~WebIntentsRegistryFactory() { | |
| 21 } | |
| 22 | |
| 23 // static | |
| 24 WebIntentsRegistryFactory* WebIntentsRegistryFactory::GetInstance() { | |
| 25 return Singleton<WebIntentsRegistryFactory>::get(); | |
| 26 } | |
| 27 | |
| 28 ProfileKeyedService* WebIntentsRegistryFactory::BuildServiceInstanceFor( | |
| 29 Profile* profile) const { | |
| 30 WebIntentsRegistry* registry = new WebIntentsRegistry; | |
| 31 registry->Initialize(profile->GetWebDataService(Profile::EXPLICIT_ACCESS)); | |
| 32 return registry; | |
| 33 } | |
| 34 | |
| 35 bool WebIntentsRegistryFactory::ServiceRedirectedInIncognito() { | |
| 36 return false; | |
| 37 } | |
| OLD | NEW |