1 // Copyright 2015 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/launcher_search_provider/service_factory.h"
7 #include "chrome/browser/chromeos/launcher_search_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 launcher_search_provider
{
16 const char kLauncherSearchProviderServiceName
[] =
17 "LauncherSearchProviderService";
21 Service
* ServiceFactory::Get(content::BrowserContext
* context
) {
22 return static_cast<Service
*>(
23 GetInstance()->GetServiceForBrowserContext(context
, true));
27 ServiceFactory
* ServiceFactory::GetInstance() {
28 return Singleton
<ServiceFactory
>::get();
31 ServiceFactory::ServiceFactory()
32 : BrowserContextKeyedServiceFactory(
33 kLauncherSearchProviderServiceName
,
34 BrowserContextDependencyManager::GetInstance()) {
35 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
38 ServiceFactory::~ServiceFactory() {
41 KeyedService
* ServiceFactory::BuildServiceInstanceFor(
42 content::BrowserContext
* profile
) const {
44 Profile::FromBrowserContext(profile
),
45 extensions::ExtensionRegistry::Get(Profile::FromBrowserContext(profile
)));
48 bool ServiceFactory::ServiceIsCreatedWithBrowserContext() const {
52 } // namespace launcher_search_provider
53 } // namespace chromeos