| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/extension_garbage_collector_factory.h" | 5 #include "chrome/browser/extensions/extension_garbage_collector_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
| 8 #include "chrome/browser/extensions/extension_garbage_collector.h" | 8 #include "chrome/browser/extensions/extension_garbage_collector.h" |
| 9 #include "chrome/browser/extensions/extension_system_factory.h" | 9 #include "chrome/browser/extensions/extension_system_factory.h" |
| 10 #include "chrome/browser/extensions/install_tracker_factory.h" | 10 #include "chrome/browser/extensions/install_tracker_factory.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 : BrowserContextKeyedServiceFactory( | 35 : BrowserContextKeyedServiceFactory( |
| 36 "ExtensionGarbageCollector", | 36 "ExtensionGarbageCollector", |
| 37 BrowserContextDependencyManager::GetInstance()) { | 37 BrowserContextDependencyManager::GetInstance()) { |
| 38 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 38 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 39 DependsOn(InstallTrackerFactory::GetInstance()); | 39 DependsOn(InstallTrackerFactory::GetInstance()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 ExtensionGarbageCollectorFactory::~ExtensionGarbageCollectorFactory() {} | 42 ExtensionGarbageCollectorFactory::~ExtensionGarbageCollectorFactory() {} |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 KeyedService* ExtensionGarbageCollectorFactory::BuildInstanceFor( | 45 scoped_ptr<KeyedService> ExtensionGarbageCollectorFactory::BuildInstanceFor( |
| 46 content::BrowserContext* context) { | 46 content::BrowserContext* context) { |
| 47 #if defined(OS_CHROMEOS) | 47 #if defined(OS_CHROMEOS) |
| 48 return new ExtensionGarbageCollectorChromeOS(context); | 48 return make_scoped_ptr(new ExtensionGarbageCollectorChromeOS(context)); |
| 49 #else | 49 #else |
| 50 return new ExtensionGarbageCollector(context); | 50 return make_scoped_ptr(new ExtensionGarbageCollector(context)); |
| 51 #endif | 51 #endif |
| 52 } | 52 } |
| 53 | 53 |
| 54 KeyedService* ExtensionGarbageCollectorFactory::BuildServiceInstanceFor( | 54 KeyedService* ExtensionGarbageCollectorFactory::BuildServiceInstanceFor( |
| 55 content::BrowserContext* context) const { | 55 content::BrowserContext* context) const { |
| 56 return BuildInstanceFor(context); | 56 return BuildInstanceFor(context).release(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 bool ExtensionGarbageCollectorFactory::ServiceIsCreatedWithBrowserContext() | 59 bool ExtensionGarbageCollectorFactory::ServiceIsCreatedWithBrowserContext() |
| 60 const { | 60 const { |
| 61 return true; | 61 return true; |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool ExtensionGarbageCollectorFactory::ServiceIsNULLWhileTesting() const { | 64 bool ExtensionGarbageCollectorFactory::ServiceIsNULLWhileTesting() const { |
| 65 return true; | 65 return true; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace extensions | 68 } // namespace extensions |
| OLD | NEW |