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

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

Issue 192573002: [fsp] Introduce file_system_provider::Service class for the FileSystemProvider API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplified. Created 6 years, 9 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
(Empty)
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.
4
5 #include "chrome/browser/chromeos/file_system_provider/service_factory.h"
6
7 #include "chrome/browser/chromeos/file_system_provider/service.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9
10 namespace chromeos {
11 namespace file_system_provider {
12
13 // static
14 Service* ServiceFactory::Get(content::BrowserContext* context) {
15 return static_cast<Service*>(
16 GetInstance()->GetServiceForBrowserContext(context, true));
17 }
18
19 ServiceFactory* ServiceFactory::GetInstance() {
20 return Singleton<ServiceFactory>::get();
21 }
22
23 ServiceFactory::ServiceFactory()
24 : BrowserContextKeyedServiceFactory(
25 "Service",
26 BrowserContextDependencyManager::GetInstance()) {}
27
28 ServiceFactory::~ServiceFactory() {}
29
30 KeyedService* ServiceFactory::BuildServiceInstanceFor(
31 content::BrowserContext* profile) const {
32 return new Service(static_cast<Profile*>(profile));
33 }
34
35 bool ServiceFactory::ServiceIsCreatedWithBrowserContext() const { return true; }
36
37 } // namespace file_system_provider
38 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698