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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java

Issue 2363183002: Skip installation process if WebAPK is already installed. (Closed)
Patch Set: Addressing comments Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/android/banners/app_banner_infobar_delegate_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
index b174519765b4af9ef2162054881fadbf36241fd6..3a7d1b83beb75bb5dd7e7c310c3b7a8aa10ba6d1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
@@ -455,16 +455,22 @@ public class ShortcutHelper {
}
/**
- * Returns true if WebAPKs are enabled and there is a WebAPK installed which can handle
+ * Returns the package name of the WebAPK if WebAPKs are enabled and there is an installed
+ * WebAPK which can handle {@link url}. Returns null otherwise.
+ */
+ @CalledByNative
+ private static String queryWebApkPackage(String url) {
+ if (!ChromeWebApkHost.isEnabled()) return null;
+ return WebApkValidator.queryWebApkPackage(ContextUtils.getApplicationContext(), url);
+ }
+
+ /**
+ * Returns true if WebAPKs are enabled and there is an installed WebAPK which can handle
* {@link url}.
*/
@CalledByNative
private static boolean isWebApkInstalled(String url) {
- if (!ChromeWebApkHost.isEnabled()) {
- return false;
- }
- return WebApkValidator.queryWebApkPackage(ContextUtils.getApplicationContext(), url)
- != null;
+ return queryWebApkPackage(url) != null;
}
/**
« no previous file with comments | « no previous file | chrome/browser/android/banners/app_banner_infobar_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698