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

Unified Diff: chrome/browser/android/shortcut_helper.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/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index 1536a9ad36607c177243cc6cb253e8eee2637c17..d6774acc8ece434fb1316ae72753b2682f7c9c32 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -268,9 +268,12 @@ bool ShortcutHelper::IsWebApkInstalled(
content::BrowserContext* browser_context,
const GURL& start_url,
const GURL& manifest_url) {
- return !QueryWebApkPackage(start_url).empty() ||
- WebApkInstallService::Get(browser_context)
- ->IsInstallInProgress(manifest_url);
+ if (!QueryWebApkPackage(start_url).empty())
+ return true;
+ if (!ChromeWebApkHost::AreWebApkEnabled())
+ return false;
+ WebApkInstallService* service = WebApkInstallService::Get(browser_context);
+ return service != nullptr && service->IsInstallInProgress(manifest_url);
pkotwicz 2017/01/12 15:37:42 This is no longer necessary?
Xi Han 2017/01/12 15:50:36 I am just not 100 presents sure whether it is nece
}
GURL ShortcutHelper::GetScopeFromURL(const GURL& url) {

Powered by Google App Engine
This is Rietveld 408576698