Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Side by Side Diff: chrome/browser/chromeos/file_system_provider/service_factory.cc

Issue 296003012: [fsp] Introduce chrome://fsp-internals for logging and debugging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed indentation. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/file_system_provider/service_factory.h" 5 #include "chrome/browser/chromeos/file_system_provider/service_factory.h"
6 6
7 #include "chrome/browser/chromeos/file_system_provider/service.h" 7 #include "chrome/browser/chromeos/file_system_provider/service.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "extensions/browser/extension_registry.h" 9 #include "extensions/browser/extension_registry.h"
10 #include "extensions/browser/extension_registry_factory.h" 10 #include "extensions/browser/extension_registry_factory.h"
11 11
12 namespace chromeos { 12 namespace chromeos {
13 namespace file_system_provider { 13 namespace file_system_provider {
14 14
15 // static 15 // static
16 Service* ServiceFactory::Get(content::BrowserContext* context) { 16 Service* ServiceFactory::Get(content::BrowserContext* context) {
17 return static_cast<Service*>( 17 return static_cast<Service*>(
18 GetInstance()->GetServiceForBrowserContext(context, true)); 18 GetInstance()->GetServiceForBrowserContext(context, true));
19 } 19 }
20 20
21 // static
22 Service* ServiceFactory::FindExisting(content::BrowserContext* context) {
23 return static_cast<Service*>(
24 GetInstance()->GetServiceForBrowserContext(context, false));
25 }
26
21 ServiceFactory* ServiceFactory::GetInstance() { 27 ServiceFactory* ServiceFactory::GetInstance() {
22 return Singleton<ServiceFactory>::get(); 28 return Singleton<ServiceFactory>::get();
23 } 29 }
24 30
25 ServiceFactory::ServiceFactory() 31 ServiceFactory::ServiceFactory()
26 : BrowserContextKeyedServiceFactory( 32 : BrowserContextKeyedServiceFactory(
27 "Service", 33 "Service",
28 BrowserContextDependencyManager::GetInstance()) { 34 BrowserContextDependencyManager::GetInstance()) {
29 DependsOn(extensions::ExtensionRegistryFactory::GetInstance()); 35 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
30 } 36 }
31 37
32 ServiceFactory::~ServiceFactory() {} 38 ServiceFactory::~ServiceFactory() {}
33 39
34 KeyedService* ServiceFactory::BuildServiceInstanceFor( 40 KeyedService* ServiceFactory::BuildServiceInstanceFor(
35 content::BrowserContext* profile) const { 41 content::BrowserContext* profile) const {
36 return new Service( 42 return new Service(
37 Profile::FromBrowserContext(profile), 43 Profile::FromBrowserContext(profile),
38 extensions::ExtensionRegistry::Get(Profile::FromBrowserContext(profile))); 44 extensions::ExtensionRegistry::Get(Profile::FromBrowserContext(profile)));
39 } 45 }
40 46
41 bool ServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; } 47 bool ServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; }
42 48
43 } // namespace file_system_provider 49 } // namespace file_system_provider
44 } // namespace chromeos 50 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_system_provider/service_factory.h ('k') | chrome/browser/resources/chromeos/fsp_internals.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698