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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/webapk/webapk_install_service_factory.cc
diff --git a/chrome/browser/android/webapk/webapk_install_service_factory.cc b/chrome/browser/android/webapk/webapk_install_service_factory.cc
index 504532c479f52af1acd66fd027376f1c262dda14..2d2ac3ed5218a3f58e57443bcadda05d18b53e49 100644
--- a/chrome/browser/android/webapk/webapk_install_service_factory.cc
+++ b/chrome/browser/android/webapk/webapk_install_service_factory.cc
@@ -30,3 +30,11 @@ KeyedService* WebApkInstallServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
return new WebApkInstallService(context);
}
+
+content::BrowserContext* WebApkInstallServiceFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ // Returns the original (possibly off-the-record) browser context so that a
+ // separate instance of the WebApkInstallerService is used in incognito mode.
+ // 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.
+ return context;
+}

Powered by Google App Engine
This is Rietveld 408576698