Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / chromeos / launcher_search_provider / service_factory.cc
blobd89ad965f745470af5156152b7f9f16f210e627f
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"
12 namespace chromeos {
13 namespace launcher_search_provider {
15 namespace {
16 const char kLauncherSearchProviderServiceName[] =
17 "LauncherSearchProviderService";
18 } // namespace
20 // static
21 Service* ServiceFactory::Get(content::BrowserContext* context) {
22 return static_cast<Service*>(
23 GetInstance()->GetServiceForBrowserContext(context, true));
26 // static
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 {
43 return new Service(
44 Profile::FromBrowserContext(profile),
45 extensions::ExtensionRegistry::Get(Profile::FromBrowserContext(profile)));
48 bool ServiceFactory::ServiceIsCreatedWithBrowserContext() const {
49 return true;
52 } // namespace launcher_search_provider
53 } // namespace chromeos