Don't swallow ChromeViewMsg_LoadBlockedPlugins messages in ChromePluginPlaceholder.
[chromium-blink-merge.git] / apps / app_lifetime_monitor_factory.cc
blob1fb799458cbb72b5911eda95dfec1a209df9f790
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_lifetime_monitor_factory.h"
7 #include "apps/app_lifetime_monitor.h"
8 #include "apps/shell_window_registry.h"
9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
13 namespace apps {
15 // static
16 AppLifetimeMonitor* AppLifetimeMonitorFactory::GetForProfile(Profile* profile) {
17 return static_cast<AppLifetimeMonitor*>(
18 GetInstance()->GetServiceForBrowserContext(profile, false));
21 AppLifetimeMonitorFactory* AppLifetimeMonitorFactory::GetInstance() {
22 return Singleton<AppLifetimeMonitorFactory>::get();
25 AppLifetimeMonitorFactory::AppLifetimeMonitorFactory()
26 : BrowserContextKeyedServiceFactory(
27 "AppLifetimeMonitor",
28 BrowserContextDependencyManager::GetInstance()) {
29 DependsOn(ShellWindowRegistry::Factory::GetInstance());
32 AppLifetimeMonitorFactory::~AppLifetimeMonitorFactory() {}
34 BrowserContextKeyedService* AppLifetimeMonitorFactory::BuildServiceInstanceFor(
35 content::BrowserContext* profile) const {
36 return new AppLifetimeMonitor(static_cast<Profile*>(profile));
39 bool AppLifetimeMonitorFactory::ServiceIsCreatedWithBrowserContext() const {
40 return true;
43 content::BrowserContext* AppLifetimeMonitorFactory::GetBrowserContextToUse(
44 content::BrowserContext* context) const {
45 return chrome::GetBrowserContextRedirectedInIncognito(context);
48 } // namespace apps