[email protected] | c4bdf9d | 2014-03-19 11:50:05 | [diff] [blame] | 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 "apps/browser_context_keyed_service_factories.h" | ||||
6 | |||||
michaelpg | dbdcdcc | 2017-04-06 01:40:56 | [diff] [blame] | 7 | #include "apps/app_restore_service.h" |
[email protected] | c4bdf9d | 2014-03-19 11:50:05 | [diff] [blame] | 8 | #include "apps/app_restore_service_factory.h" |
michaelpg | dbdcdcc | 2017-04-06 01:40:56 | [diff] [blame] | 9 | #include "apps/saved_files_service.h" |
10 | #include "apps/saved_files_service_factory.h" | ||||
11 | #include "content/public/browser/browser_context.h" | ||||
[email protected] | 21d3f3a | 2014-08-20 09:39:55 | [diff] [blame] | 12 | #include "extensions/browser/app_window/app_window_geometry_cache.h" |
[email protected] | c4bdf9d | 2014-03-19 11:50:05 | [diff] [blame] | 13 | |
14 | namespace apps { | ||||
15 | |||||
16 | void EnsureBrowserContextKeyedServiceFactoriesBuilt() { | ||||
[email protected] | c4bdf9d | 2014-03-19 11:50:05 | [diff] [blame] | 17 | apps::AppRestoreServiceFactory::GetInstance(); |
[email protected] | 21d3f3a | 2014-08-20 09:39:55 | [diff] [blame] | 18 | extensions::AppWindowGeometryCache::Factory::GetInstance(); |
[email protected] | c4bdf9d | 2014-03-19 11:50:05 | [diff] [blame] | 19 | } |
20 | |||||
michaelpg | dbdcdcc | 2017-04-06 01:40:56 | [diff] [blame] | 21 | void 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] | c4bdf9d | 2014-03-19 11:50:05 | [diff] [blame] | 33 | } // namespace apps |