Adding win8/ and chrome_frame/ to _CheckForString16() whitelist.
[chromium-blink-merge.git] / apps / app_load_service_factory.cc
bloba296d3465426ec050cc20176f35ed6c27ec6a8d6
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.
5 #include "apps/app_load_service_factory.h"
7 #include "apps/app_load_service.h"
8 #include "apps/shell_window_registry.h"
9 #include "chrome/browser/extensions/extension_prefs_factory.h"
10 #include "chrome/browser/extensions/extension_system_factory.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
13 #include "extensions/browser/extensions_browser_client.h"
15 namespace apps {
17 // static
18 AppLoadService* AppLoadServiceFactory::GetForProfile(Profile* profile) {
19 return static_cast<AppLoadService*>(
20 GetInstance()->GetServiceForBrowserContext(profile, true));
23 AppLoadServiceFactory* AppLoadServiceFactory::GetInstance() {
24 return Singleton<AppLoadServiceFactory>::get();
27 AppLoadServiceFactory::AppLoadServiceFactory()
28 : BrowserContextKeyedServiceFactory(
29 "AppLoadService",
30 BrowserContextDependencyManager::GetInstance()) {
31 DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
32 DependsOn(extensions::ExtensionSystemFactory::GetInstance());
33 DependsOn(ShellWindowRegistry::Factory::GetInstance());
36 AppLoadServiceFactory::~AppLoadServiceFactory() {
39 BrowserContextKeyedService* AppLoadServiceFactory::BuildServiceInstanceFor(
40 content::BrowserContext* profile) const {
41 return new AppLoadService(static_cast<Profile*>(profile));
44 bool AppLoadServiceFactory::ServiceIsNULLWhileTesting() const {
45 return false;
48 bool AppLoadServiceFactory::ServiceIsCreatedWithBrowserContext() const {
49 return true;
52 content::BrowserContext* AppLoadServiceFactory::GetBrowserContextToUse(
53 content::BrowserContext* context) const {
54 // Redirected in incognito.
55 return extensions::ExtensionsBrowserClient::Get()->
56 GetOriginalContext(context);
59 } // namespace apps