Remove LOG(ERROR)
[chromium-blink-merge.git] / apps / app_keep_alive_service_factory.cc
blobdc9e725235a9b633d2686cf90d69893789978632
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_keep_alive_service_factory.h"
7 #include "apps/app_keep_alive_service.h"
8 #include "apps/app_lifetime_monitor_factory.h"
9 #include "apps/shell_window_registry.h"
10 #include "chrome/browser/profiles/incognito_helpers.h"
11 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
13 namespace apps {
15 // static
16 AppKeepAliveServiceFactory* AppKeepAliveServiceFactory::GetInstance() {
17 return Singleton<AppKeepAliveServiceFactory>::get();
20 AppKeepAliveServiceFactory::AppKeepAliveServiceFactory()
21 : BrowserContextKeyedServiceFactory(
22 "AppKeepAliveService",
23 BrowserContextDependencyManager::GetInstance()) {
24 DependsOn(AppLifetimeMonitorFactory::GetInstance());
27 AppKeepAliveServiceFactory::~AppKeepAliveServiceFactory() {}
29 BrowserContextKeyedService* AppKeepAliveServiceFactory::BuildServiceInstanceFor(
30 content::BrowserContext* context) const {
31 return new AppKeepAliveService(context);
34 bool AppKeepAliveServiceFactory::ServiceIsCreatedWithBrowserContext() const {
35 return true;
38 content::BrowserContext* AppKeepAliveServiceFactory::GetBrowserContextToUse(
39 content::BrowserContext* context) const {
40 return chrome::GetBrowserContextRedirectedInIncognito(context);
43 bool AppKeepAliveServiceFactory::ServiceIsNULLWhileTesting() const {
44 return true;
47 } // namespace apps