[M120 Migration][HBBTV] Implement ewk_context_register_jsplugin_mime_types
[platform/framework/web/chromium-efl.git] / apps / browser_context_keyed_service_factories.cc
1 // Copyright 2014 The Chromium Authors
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
7 #include "apps/app_lifetime_monitor_factory.h"
8 #include "apps/app_restore_service.h"
9 #include "apps/app_restore_service_factory.h"
10 #include "apps/saved_files_service.h"
11 #include "apps/saved_files_service_factory.h"
12 #include "content/public/browser/browser_context.h"
13
14 namespace apps {
15
16 void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
17   AppLifetimeMonitorFactory::GetInstance();
18   AppRestoreServiceFactory::GetInstance();
19   SavedFilesServiceFactory::GetInstance();
20 }
21
22 void NotifyApplicationTerminating(content::BrowserContext* browser_context) {
23   AppRestoreService* restore_service =
24       AppRestoreServiceFactory::GetForBrowserContext(browser_context);
25   CHECK(restore_service);
26   restore_service->OnApplicationTerminating();
27
28   SavedFilesService* saved_files_service =
29       SavedFilesServiceFactory::GetForBrowserContextIfExists(browser_context);
30   if (saved_files_service)
31     saved_files_service->OnApplicationTerminating();
32 }
33
34 }  // namespace apps