forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowser_context_keyed_service_factories.cc
33 lines (26 loc) · 1.16 KB
/
browser_context_keyed_service_factories.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "apps/browser_context_keyed_service_factories.h"
#include "apps/app_restore_service.h"
#include "apps/app_restore_service_factory.h"
#include "apps/saved_files_service.h"
#include "apps/saved_files_service_factory.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/app_window/app_window_geometry_cache.h"
namespace apps {
void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
apps::AppRestoreServiceFactory::GetInstance();
extensions::AppWindowGeometryCache::Factory::GetInstance();
}
void NotifyApplicationTerminating(content::BrowserContext* browser_context) {
AppRestoreService* restore_service =
AppRestoreServiceFactory::GetForBrowserContext(browser_context);
CHECK(restore_service);
restore_service->OnApplicationTerminating();
SavedFilesService* saved_files_service =
SavedFilesServiceFactory::GetForBrowserContextIfExists(browser_context);
if (saved_files_service)
saved_files_service->OnApplicationTerminating();
}
} // namespace apps