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

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

Issue 2620403002: Fix WebApkInstallService::IsInstallInProgress() crash. (Closed)
Patch Set: Handle the incognito mode. 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
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 "components/keyed_service/content/browser_context_dependency_manager.h" 8 #include "components/keyed_service/content/browser_context_dependency_manager.h"
9 9
10 // static 10 // static
(...skipping 12 matching lines...) Expand all
23 : BrowserContextKeyedServiceFactory( 23 : BrowserContextKeyedServiceFactory(
24 "WebApkInstallService", 24 "WebApkInstallService",
25 BrowserContextDependencyManager::GetInstance()) {} 25 BrowserContextDependencyManager::GetInstance()) {}
26 26
27 WebApkInstallServiceFactory::~WebApkInstallServiceFactory() {} 27 WebApkInstallServiceFactory::~WebApkInstallServiceFactory() {}
28 28
29 KeyedService* WebApkInstallServiceFactory::BuildServiceInstanceFor( 29 KeyedService* WebApkInstallServiceFactory::BuildServiceInstanceFor(
30 content::BrowserContext* context) const { 30 content::BrowserContext* context) const {
31 return new WebApkInstallService(context); 31 return new WebApkInstallService(context);
32 } 32 }
33
34 content::BrowserContext* WebApkInstallServiceFactory::GetBrowserContextToUse(
35 content::BrowserContext* context) const {
36 // Returns the original (possibly off-the-record) browser context so that a
37 // separate instance of the WebApkInstallerService is used in incognito mode.
38 // The base class's implementation returns nullptr.
pkotwicz 2017/01/12 15:37:42 Are you sure that you want incognito and non-incog
Xi Han 2017/01/12 15:50:36 Makes sense.
pkotwicz 2017/01/12 15:55:40 I think that you should be using GetBrowserContext
Xi Han 2017/01/12 16:25:23 Oops, choose the wrong one.
39 return context;
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698