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 "chrome/browser/chromeos/file_system_provider/service_factory.h"
7 #include "chrome/browser/chromeos/file_system_provider/service.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "extensions/browser/extension_registry.h"
10 #include "extensions/browser/extension_registry_factory.h"
13 namespace file_system_provider
{
16 Service
* ServiceFactory::Get(content::BrowserContext
* context
) {
17 return static_cast<Service
*>(
18 GetInstance()->GetServiceForBrowserContext(context
, true));
21 ServiceFactory
* ServiceFactory::GetInstance() {
22 return Singleton
<ServiceFactory
>::get();
25 ServiceFactory::ServiceFactory()
26 : BrowserContextKeyedServiceFactory(
28 BrowserContextDependencyManager::GetInstance()) {
29 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
32 ServiceFactory::~ServiceFactory() {}
34 KeyedService
* ServiceFactory::BuildServiceInstanceFor(
35 content::BrowserContext
* profile
) const {
37 Profile::FromBrowserContext(profile
),
38 extensions::ExtensionRegistry::Get(Profile::FromBrowserContext(profile
)));
41 bool ServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; }
43 } // namespace file_system_provider
44 } // namespace chromeos