[M108 Migration][Callback] Bring up ewk callbacks which are related with page loading
[platform/framework/web/chromium-efl.git] / apps / app_restore_service_factory.cc
1 // Copyright 2012 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/app_restore_service_factory.h"
6
7 #include "apps/app_lifetime_monitor_factory.h"
8 #include "apps/app_restore_service.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "content/public/browser/browser_context.h"
11 #include "extensions/browser/extensions_browser_client.h"
12
13 namespace apps {
14
15 // static
16 AppRestoreService* AppRestoreServiceFactory::GetForBrowserContext(
17     content::BrowserContext* context) {
18   return static_cast<AppRestoreService*>(
19       GetInstance()->GetServiceForBrowserContext(context, true));
20 }
21
22 AppRestoreServiceFactory* AppRestoreServiceFactory::GetInstance() {
23   return base::Singleton<AppRestoreServiceFactory>::get();
24 }
25
26 AppRestoreServiceFactory::AppRestoreServiceFactory()
27     : BrowserContextKeyedServiceFactory(
28         "AppRestoreService",
29         BrowserContextDependencyManager::GetInstance()) {
30   DependsOn(AppLifetimeMonitorFactory::GetInstance());
31 }
32
33 AppRestoreServiceFactory::~AppRestoreServiceFactory() = default;
34
35 KeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor(
36     content::BrowserContext* context) const {
37   return new AppRestoreService(context);
38 }
39
40 bool AppRestoreServiceFactory::ServiceIsCreatedWithBrowserContext() const {
41   return true;
42 }
43
44 content::BrowserContext* AppRestoreServiceFactory::GetBrowserContextToUse(
45     content::BrowserContext* context) const {
46   return extensions::ExtensionsBrowserClient::Get()
47       ->GetRedirectedContextInIncognito(context, /*force_guest_profile=*/true,
48                                         /*force_system_profile=*/false);
49 }
50
51 }  // namespace apps