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
3 // found in the LICENSE file.
5 #include "extensions/browser/updater/update_service_factory.h"
7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "extensions/browser/extension_registry_factory.h"
9 #include "extensions/browser/process_manager_factory.h"
10 #include "extensions/browser/updater/update_service.h"
12 namespace extensions
{
15 UpdateService
* UpdateServiceFactory::GetForBrowserContext(
16 content::BrowserContext
* context
) {
17 return static_cast<UpdateService
*>(
18 GetInstance()->GetServiceForBrowserContext(context
, true));
22 UpdateServiceFactory
* UpdateServiceFactory::GetInstance() {
23 return Singleton
<UpdateServiceFactory
>::get();
26 UpdateServiceFactory::UpdateServiceFactory()
27 : BrowserContextKeyedServiceFactory(
29 BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
31 DependsOn(extensions::ProcessManagerFactory::GetInstance());
34 UpdateServiceFactory::~UpdateServiceFactory() {
37 KeyedService
* UpdateServiceFactory::BuildServiceInstanceFor(
38 content::BrowserContext
* context
) const {
39 return new UpdateService(context
);
42 } // namespace extensions