Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: apps/app_load_service_factory.cc

Issue 2789253003: Add chrome/browser/apps/BUILD.gn and move Chrome-specific code there (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « apps/app_load_service_factory.h ('k') | apps/browser_context_keyed_service_factories.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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/app_load_service_factory.h"
6
7 #include "apps/app_load_service.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 #include "content/public/browser/browser_context.h"
10 #include "extensions/browser/app_window/app_window_registry.h"
11 #include "extensions/browser/extension_prefs_factory.h"
12 #include "extensions/browser/extension_registry_factory.h"
13 #include "extensions/browser/extension_system_provider.h"
14 #include "extensions/browser/extensions_browser_client.h"
15
16 namespace apps {
17
18 // static
19 AppLoadService* AppLoadServiceFactory::GetForBrowserContext(
20 content::BrowserContext* context) {
21 return static_cast<AppLoadService*>(
22 GetInstance()->GetServiceForBrowserContext(context, true));
23 }
24
25 AppLoadServiceFactory* AppLoadServiceFactory::GetInstance() {
26 return base::Singleton<AppLoadServiceFactory>::get();
27 }
28
29 AppLoadServiceFactory::AppLoadServiceFactory()
30 : BrowserContextKeyedServiceFactory(
31 "AppLoadService",
32 BrowserContextDependencyManager::GetInstance()) {
33 DependsOn(extensions::AppWindowRegistry::Factory::GetInstance());
34 DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
35 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
36 DependsOn(
37 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
38 }
39
40 AppLoadServiceFactory::~AppLoadServiceFactory() {
41 }
42
43 KeyedService* AppLoadServiceFactory::BuildServiceInstanceFor(
44 content::BrowserContext* context) const {
45 return new AppLoadService(context);
46 }
47
48 bool AppLoadServiceFactory::ServiceIsNULLWhileTesting() const {
49 return false;
50 }
51
52 bool AppLoadServiceFactory::ServiceIsCreatedWithBrowserContext() const {
53 return true;
54 }
55
56 content::BrowserContext* AppLoadServiceFactory::GetBrowserContextToUse(
57 content::BrowserContext* context) const {
58 // Redirected in incognito.
59 return extensions::ExtensionsBrowserClient::Get()->
60 GetOriginalContext(context);
61 }
62
63 } // namespace apps
OLDNEW
« no previous file with comments | « apps/app_load_service_factory.h ('k') | apps/browser_context_keyed_service_factories.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698