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

Side by Side Diff: chrome/browser/android/webapk/webapk_install_service_factory.cc

Issue 2620403002: Fix WebApkInstallService::IsInstallInProgress() crash. (Closed)
Patch Set: Created 3 years, 11 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 | « chrome/browser/android/webapk/webapk_install_service_factory.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/webapk/webapk_install_service_factory.h" 5 #include "chrome/browser/android/webapk/webapk_install_service_factory.h"
6 6
7 #include "chrome/browser/android/webapk/webapk_install_service.h" 7 #include "chrome/browser/android/webapk/webapk_install_service.h"
8 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 10
10 // static 11 // static
11 WebApkInstallServiceFactory* WebApkInstallServiceFactory::GetInstance() { 12 WebApkInstallServiceFactory* WebApkInstallServiceFactory::GetInstance() {
12 return base::Singleton<WebApkInstallServiceFactory>::get(); 13 return base::Singleton<WebApkInstallServiceFactory>::get();
13 } 14 }
14 15
15 // static 16 // static
16 WebApkInstallService* WebApkInstallServiceFactory::GetForBrowserContext( 17 WebApkInstallService* WebApkInstallServiceFactory::GetForBrowserContext(
17 content::BrowserContext* context) { 18 content::BrowserContext* context) {
18 return static_cast<WebApkInstallService*>( 19 return static_cast<WebApkInstallService*>(
19 GetInstance()->GetServiceForBrowserContext(context, true)); 20 GetInstance()->GetServiceForBrowserContext(context, true));
20 } 21 }
21 22
22 WebApkInstallServiceFactory::WebApkInstallServiceFactory() 23 WebApkInstallServiceFactory::WebApkInstallServiceFactory()
23 : BrowserContextKeyedServiceFactory( 24 : BrowserContextKeyedServiceFactory(
24 "WebApkInstallService", 25 "WebApkInstallService",
25 BrowserContextDependencyManager::GetInstance()) {} 26 BrowserContextDependencyManager::GetInstance()) {}
26 27
27 WebApkInstallServiceFactory::~WebApkInstallServiceFactory() {} 28 WebApkInstallServiceFactory::~WebApkInstallServiceFactory() {}
28 29
29 KeyedService* WebApkInstallServiceFactory::BuildServiceInstanceFor( 30 KeyedService* WebApkInstallServiceFactory::BuildServiceInstanceFor(
30 content::BrowserContext* context) const { 31 content::BrowserContext* context) const {
31 return new WebApkInstallService(context); 32 return new WebApkInstallService(context);
32 } 33 }
34
35 content::BrowserContext* WebApkInstallServiceFactory::GetBrowserContextToUse(
36 content::BrowserContext* context) const {
37 return chrome::GetBrowserContextRedirectedInIncognito(context);
38 }
OLDNEW
« no previous file with comments | « chrome/browser/android/webapk/webapk_install_service_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698