Chromium Code Reviews| 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 | |
| 
 
Peter Kasting
2012/06/11 00:41:26
Nit: Extra blank lines (3 places)
 
Steve McKay
2012/06/11 22:09:38
Done. Though allow me to proselytize for more whit
 
Peter Kasting
2012/06/12 00:31:37
I don't mind whitespace in general, but a blank li
 
Steve McKay
2012/06/14 22:06:23
Done.
 
 | |
| 22 return static_cast<ProtocolHandlerRegistry*>( | |
| 23 GetInstance()->GetServiceForProfile(profile, true)); | |
| 24 } | |
| 25 | |
| 26 ProtocolHandlerRegistryFactory::ProtocolHandlerRegistryFactory() | |
| 27 : ProfileKeyedServiceFactory("ProtocolHandlerRegistry", | |
| 28 ProfileDependencyManager::GetInstance()) { | |
| 29 | |
| 30 // DependsOn(WebIntentsRegistryFactory::GetInstance()); | |
| 
 
Elliot Glaysher
2012/06/11 19:43:16
Is this supposed to be uncommented? I see that Web
 
Steve McKay
2012/06/11 22:09:38
Trying to segregate CLs to keep the switch to PKS
 
Peter Kasting
2012/06/12 00:31:37
Do you mean that right now the ProtocolHandlerRegi
 
Steve McKay
2012/06/14 22:06:23
Done.
 
 | |
| 31 } | |
| 32 | |
| 33 ProtocolHandlerRegistryFactory::~ProtocolHandlerRegistryFactory() { | |
| 34 } | |
| 35 | |
| 36 ProfileKeyedService* ProtocolHandlerRegistryFactory::BuildServiceInstanceFor( | |
| 37 Profile* profile) const { | |
| 38 | |
| 39 ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry( | |
| 40 profile, | |
| 41 new ProtocolHandlerRegistry::Delegate()); | |
| 
 
Peter Kasting
2012/06/11 00:41:26
Nit: Could put on previous line
 
Steve McKay
2012/06/11 22:09:38
Done.
 
 | |
| 42 | |
| 43 registry->InitProtocolSettings(); | |
| 44 | |
| 45 return registry; | |
| 46 } | |
| 47 | |
| 48 bool ProtocolHandlerRegistryFactory::ServiceRedirectedInIncognito() { | |
| 49 return false; | |
| 
 
Peter Kasting
2012/06/11 00:41:26
This is already the default behavior.
 
Steve McKay
2012/06/11 22:09:38
Done.
 
 | |
| 50 } | |
| OLD | NEW |