Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java |
index 6db25e2016efbb497e3e62af568353c456e51fa7..d81f1d27073baa068348b83d2a61e319abcc8121 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ChromeWebApkHost.java |
@@ -47,6 +47,17 @@ public class ChromeWebApkHost { |
return isEnabledInPrefs(); |
} |
+ // Returns whether updating the WebAPK is enabled. |
+ public static boolean areUpdatesEnabled() { |
+ if (!isEnabled()) return false; |
+ |
+ // Updating a WebAPK without going through Google Play requires "installation from unknown |
+ // sources" to be enabled. It is confusing for a user to see a dialog asking them to enable |
+ // "installation from unknown sources" when they are in the middle of using the WebAPK (as |
+ // opposed to after requesting to add a WebAPK to the homescreen). |
+ return installingFromUnknownSourcesAllowed() || canUseGooglePlayToInstallWebApk(); |
+ } |
+ |
/** Return whether installing WebAPKs using Google Play is enabled. */ |
public static boolean canUseGooglePlayToInstallWebApk() { |
if (!isEnabled()) return false; |