Chromium Code Reviews| Index: chrome/browser/intents/web_intents_registry_factory.cc |
| diff --git a/chrome/browser/intents/web_intents_registry_factory.cc b/chrome/browser/intents/web_intents_registry_factory.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c210a90c27557a1c80436ca6485e7f9b51519889 |
| --- /dev/null |
| +++ b/chrome/browser/intents/web_intents_registry_factory.cc |
| @@ -0,0 +1,37 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/intents/web_intents_registry.h" |
| +#include "chrome/browser/intents/web_intents_registry_factory.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/profiles/profile_dependency_manager.h" |
| + |
| +// static |
| +WebIntentsRegistry* WebIntentsRegistryFactory::GetForProfile(Profile* profile) { |
| + return static_cast<WebIntentsRegistry*>( |
| + GetInstance()->GetServiceForProfile(profile, true)); |
| +} |
| + |
| +WebIntentsRegistryFactory::WebIntentsRegistryFactory() |
| + : 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.
|
| +} |
| + |
| +WebIntentsRegistryFactory::~WebIntentsRegistryFactory() { |
| +} |
| + |
| +// static |
| +WebIntentsRegistryFactory* WebIntentsRegistryFactory::GetInstance() { |
| + return Singleton<WebIntentsRegistryFactory>::get(); |
| +} |
| + |
| +ProfileKeyedService* WebIntentsRegistryFactory::BuildServiceInstanceFor( |
| + Profile* profile) const { |
| + WebIntentsRegistry* registry = new WebIntentsRegistry; |
| + registry->Initialize(profile->GetWebDataService(Profile::EXPLICIT_ACCESS)); |
| + return registry; |
| +} |
| + |
| +bool WebIntentsRegistryFactory::ServiceRedirectedInIncognito() { |
| + return false; |
| +} |