blob: 6f6e053db085b5e871b4e40bc85f8fc05987b737 [file] [log] [blame]
[email protected]c4bdf9d2014-03-19 11:50:051// 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 "apps/browser_context_keyed_service_factories.h"
6
Peter Kastingc7137e242020-04-09 16:36:447#include "apps/app_lifetime_monitor_factory.h"
michaelpgdbdcdcc2017-04-06 01:40:568#include "apps/app_restore_service.h"
[email protected]c4bdf9d2014-03-19 11:50:059#include "apps/app_restore_service_factory.h"
michaelpgdbdcdcc2017-04-06 01:40:5610#include "apps/saved_files_service.h"
11#include "apps/saved_files_service_factory.h"
12#include "content/public/browser/browser_context.h"
[email protected]c4bdf9d2014-03-19 11:50:0513
14namespace apps {
15
16void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
Peter Kastingc7137e242020-04-09 16:36:4417 AppLifetimeMonitorFactory::GetInstance();
Peter Kastingd6f15a6e2020-04-03 00:43:0518 AppRestoreServiceFactory::GetInstance();
[email protected]c4bdf9d2014-03-19 11:50:0519}
20
michaelpgdbdcdcc2017-04-06 01:40:5621void NotifyApplicationTerminating(content::BrowserContext* browser_context) {
22 AppRestoreService* restore_service =
23 AppRestoreServiceFactory::GetForBrowserContext(browser_context);
24 CHECK(restore_service);
25 restore_service->OnApplicationTerminating();
26
27 SavedFilesService* saved_files_service =
28 SavedFilesServiceFactory::GetForBrowserContextIfExists(browser_context);
29 if (saved_files_service)
30 saved_files_service->OnApplicationTerminating();
31}
32
[email protected]c4bdf9d2014-03-19 11:50:0533} // namespace apps