| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
| 6 |
| 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 9 #include "chrome/browser/extensions/extension_system_factory.h" |
| 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 12 |
| 13 // static |
| 14 ProtocolHandlerRegistryFactory* ProtocolHandlerRegistryFactory::GetInstance() { |
| 15 return Singleton<ProtocolHandlerRegistryFactory>::get(); |
| 16 } |
| 17 |
| 18 // static |
| 19 ProtocolHandlerRegistry* ProtocolHandlerRegistryFactory::GetForProfile( |
| 20 Profile* profile) { |
| 21 return static_cast<ProtocolHandlerRegistry*>( |
| 22 GetInstance()->GetServiceForProfile(profile, true)); |
| 23 } |
| 24 |
| 25 ProtocolHandlerRegistryFactory::ProtocolHandlerRegistryFactory() |
| 26 : ProfileKeyedServiceFactory("ProtocolHandlerRegistry", |
| 27 ProfileDependencyManager::GetInstance()) { |
| 28 |
| 29 // DependsOn(WebIntentsRegistryFactory::GetInstance()); |
| 30 } |
| 31 |
| 32 ProtocolHandlerRegistryFactory::~ProtocolHandlerRegistryFactory() { |
| 33 } |
| 34 |
| 35 ProfileKeyedService* ProtocolHandlerRegistryFactory::BuildServiceInstanceFor( |
| 36 Profile* profile) const { |
| 37 |
| 38 ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry( |
| 39 profile, new ProtocolHandlerRegistry::Delegate()); |
| 40 |
| 41 registry->InitProtocolSettings(); |
| 42 |
| 43 return registry; |
| 44 } |
| OLD | NEW |