blob: f85b315500c40f463a5743eb9a9acd76f76f8400 [file] [log] [blame]
[email protected]961745f2013-05-25 14:09:241// Copyright 2013 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 "apps/saved_files_service_factory.h"
6
7#include "apps/saved_files_service.h"
[email protected]12b7af32014-03-13 05:28:208#include "components/keyed_service/content/browser_context_dependency_manager.h"
michaelpg4d80e562017-04-04 01:48:149#include "content/public/browser/browser_context.h"
[email protected]961745f2013-05-25 14:09:2410
11namespace apps {
12
13// static
michaelpg4d80e562017-04-04 01:48:1414SavedFilesService* SavedFilesServiceFactory::GetForBrowserContext(
15 content::BrowserContext* context) {
[email protected]961745f2013-05-25 14:09:2416 return static_cast<SavedFilesService*>(
michaelpg4d80e562017-04-04 01:48:1417 GetInstance()->GetServiceForBrowserContext(context, true));
[email protected]961745f2013-05-25 14:09:2418}
19
20// static
michaelpgdbdcdcc2017-04-06 01:40:5621SavedFilesService* SavedFilesServiceFactory::GetForBrowserContextIfExists(
22 content::BrowserContext* context) {
23 return static_cast<SavedFilesService*>(
24 GetInstance()->GetServiceForBrowserContext(context, false));
25}
26
27// static
[email protected]961745f2013-05-25 14:09:2428SavedFilesServiceFactory* SavedFilesServiceFactory::GetInstance() {
olli.raula36aa8be2015-09-10 11:14:2229 return base::Singleton<SavedFilesServiceFactory>::get();
[email protected]961745f2013-05-25 14:09:2430}
31
32SavedFilesServiceFactory::SavedFilesServiceFactory()
33 : BrowserContextKeyedServiceFactory(
34 "SavedFilesService",
35 BrowserContextDependencyManager::GetInstance()) {}
36
37SavedFilesServiceFactory::~SavedFilesServiceFactory() {}
38
[email protected]12b7af32014-03-13 05:28:2039KeyedService* SavedFilesServiceFactory::BuildServiceInstanceFor(
michaelpg4d80e562017-04-04 01:48:1440 content::BrowserContext* context) const {
41 return new SavedFilesService(context);
[email protected]961745f2013-05-25 14:09:2442}
43
44} // namespace apps