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/custom_handlers/protocol_handler_registry_factory.h" | 5 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 8 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
9 #include "chrome/browser/extensions/extension_system_factory.h" | 9 #include "chrome/browser/extensions/extension_system_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return true; | 42 return true; |
43 } | 43 } |
44 | 44 |
45 // Do not create this service for tests. MANY tests will fail | 45 // Do not create this service for tests. MANY tests will fail |
46 // due to the threading requirements of this service. ALSO, | 46 // due to the threading requirements of this service. ALSO, |
47 // not creating this increases test isolation (which is GOOD!) | 47 // not creating this increases test isolation (which is GOOD!) |
48 bool ProtocolHandlerRegistryFactory::ServiceIsNULLWhileTesting() const { | 48 bool ProtocolHandlerRegistryFactory::ServiceIsNULLWhileTesting() const { |
49 return true; | 49 return true; |
50 } | 50 } |
51 | 51 |
| 52 bool ProtocolHandlerRegistryFactory::ServiceIsNULLOnImportProcess() const { |
| 53 return false; |
| 54 } |
| 55 |
52 ProfileKeyedService* ProtocolHandlerRegistryFactory::BuildServiceInstanceFor( | 56 ProfileKeyedService* ProtocolHandlerRegistryFactory::BuildServiceInstanceFor( |
53 Profile* profile) const { | 57 Profile* profile) const { |
54 ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry( | 58 ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry( |
55 profile, new ProtocolHandlerRegistry::Delegate()); | 59 profile, new ProtocolHandlerRegistry::Delegate()); |
56 | 60 |
57 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
58 // If installing defaults, they must be installed prior calling | 62 // If installing defaults, they must be installed prior calling |
59 // InitProtocolSettings | 63 // InitProtocolSettings |
60 registry->InstallDefaultsForChromeOS(); | 64 registry->InstallDefaultsForChromeOS(); |
61 #endif | 65 #endif |
62 | 66 |
63 // Must be called as a part of the creation process. | 67 // Must be called as a part of the creation process. |
64 registry->InitProtocolSettings(); | 68 registry->InitProtocolSettings(); |
65 | 69 |
66 return registry; | 70 return registry; |
67 } | 71 } |
OLD | NEW |