blob: 2267b2483c8236fd0824967ead6dd969c3db704b [file] [log] [blame]
[email protected]28c3eeb2012-10-15 05:47:531// Copyright (c) 2012 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
[email protected]c2e2b6d2013-01-22 02:23:295#include "apps/app_restore_service_factory.h"
[email protected]28c3eeb2012-10-15 05:47:536
[email protected]4b7111f22013-06-18 14:22:127#include "apps/app_lifetime_monitor_factory.h"
[email protected]c2e2b6d2013-01-22 02:23:298#include "apps/app_restore_service.h"
[email protected]12b7af32014-03-13 05:28:209#include "components/keyed_service/content/browser_context_dependency_manager.h"
michaelpg4d80e562017-04-04 01:48:1410#include "content/public/browser/browser_context.h"
[email protected]28c3eeb2012-10-15 05:47:5311
[email protected]c2e2b6d2013-01-22 02:23:2912namespace apps {
[email protected]28c3eeb2012-10-15 05:47:5313
14// static
michaelpg4d80e562017-04-04 01:48:1415AppRestoreService* AppRestoreServiceFactory::GetForBrowserContext(
16 content::BrowserContext* context) {
[email protected]28c3eeb2012-10-15 05:47:5317 return static_cast<AppRestoreService*>(
michaelpg4d80e562017-04-04 01:48:1418 GetInstance()->GetServiceForBrowserContext(context, true));
[email protected]28c3eeb2012-10-15 05:47:5319}
20
[email protected]28c3eeb2012-10-15 05:47:5321AppRestoreServiceFactory* AppRestoreServiceFactory::GetInstance() {
olli.raula36aa8be2015-09-10 11:14:2222 return base::Singleton<AppRestoreServiceFactory>::get();
[email protected]28c3eeb2012-10-15 05:47:5323}
24
25AppRestoreServiceFactory::AppRestoreServiceFactory()
[email protected]f1484c52013-05-22 23:25:4426 : BrowserContextKeyedServiceFactory(
27 "AppRestoreService",
28 BrowserContextDependencyManager::GetInstance()) {
[email protected]4b7111f22013-06-18 14:22:1229 DependsOn(AppLifetimeMonitorFactory::GetInstance());
[email protected]28c3eeb2012-10-15 05:47:5330}
31
Chris Watkinsee8488b2017-11-27 04:06:5632AppRestoreServiceFactory::~AppRestoreServiceFactory() = default;
[email protected]28c3eeb2012-10-15 05:47:5333
[email protected]12b7af32014-03-13 05:28:2034KeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor(
michaelpg4d80e562017-04-04 01:48:1435 content::BrowserContext* context) const {
36 return new AppRestoreService(context);
[email protected]28c3eeb2012-10-15 05:47:5337}
38
[email protected]f1484c52013-05-22 23:25:4439bool AppRestoreServiceFactory::ServiceIsCreatedWithBrowserContext() const {
[email protected]28c3eeb2012-10-15 05:47:5340 return true;
41}
42
[email protected]c2e2b6d2013-01-22 02:23:2943} // namespace apps