Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / chromeos / file_system_provider / service_factory.cc
blob4c618c13ea99486d33a8a0ad3d7f07b1f568c005
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"
12 namespace chromeos {
13 namespace file_system_provider {
15 // static
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(
27 "Service",
28 BrowserContextDependencyManager::GetInstance()) {
29 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
32 ServiceFactory::~ServiceFactory() {}
34 KeyedService* ServiceFactory::BuildServiceInstanceFor(
35 content::BrowserContext* profile) const {
36 return new Service(
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