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

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

Issue 2675803004: Fall back to shortcut A2HS when Phonesky is out of date or unavailable. (Closed)
Patch Set: Update add_to_homescreen_data_fetcher_unittest.cc. Created 3 years, 10 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/android/java/src/org/chromium/chrome/browser/webapps/GooglePlayWebApkInstallDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/GooglePlayWebApkInstallDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/GooglePlayWebApkInstallDelegate.java
index 5bcfc29be1eda30ca1c86f1e8a9deb4b03adda78..50624d363e2f039a148d32936b945ce1da5ce449 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/GooglePlayWebApkInstallDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/GooglePlayWebApkInstallDelegate.java
@@ -32,6 +32,40 @@ public interface GooglePlayWebApkInstallDelegate {
public static final int INSTALLED = 6;
/**
+ * Status code indicating that the installation request has been successfully processed and
+ * installation has been scheduled.
+ */
+ public static final int STATUS_CODE_SUCCESS = 0;
+
+ /**
+ * Status code indicating that the installation request has been rejected due to caller
+ * verification failure.
+ */
+ public static final int STATUS_CODE_CALLER_VERIFICATION_FAILURE = -1;
+
+ /**
+ * Status code indicating that the installation request has been rejected because the caller is
+ * not allowed to install a given package.
+ */
+ public static final int STATUS_CODE_POLICY_VIOLATION = -2;
+
+ /**
+ * Status code indicating that the install api is currently disabled.
+ */
+ public static final int STATUS_CODE_API_DISABLED = -3;
+ /**
+ * Status code indicating that the install request has failed. error Bundle field in the
+ * response bundle will contain failure reason.
+ */
+ public static final int STATUS_CODE_REQUEST_FAILED = -4;
+
+ /**
+ * Status code indicating that it fails to bind to the Google Play Service.
+ */
+ public static final int STATUS_CODE_FAIL_TO_BIND_TO_SERVICE = -5;
+
+ public static final int STATUS_CODE_OTHERS = -6;
+ /**
* Uses Google Play to install WebAPK asynchronously.
* @param packageName The package name of WebAPK to install.
* @param version The version of WebAPK to install.
@@ -51,4 +85,24 @@ public interface GooglePlayWebApkInstallDelegate {
* @param event The result of the install.
*/
void onGotInstallEvent(String packageName, @InstallerPackageEvent int event);
+
+ /**
+ * Checks whether Google Play Install API is available.
+ * @param packageName The package name of WebAPK to install.
+ * @param version The version of WebAPK to install.
+ * @param title The title of the WebAPK to display during installation.
+ * @param token The token from WebAPK Minter Server.
+ * @param url The start URL of the WebAPK to install.
+ * @param callback The callback to invoke when the check is done.
+ * @return True if the Install API is available.
+ */
+ boolean canUseInstallApi(String packageName, int version, String title, String token,
+ String url, Callback<Boolean> callback);
+
+ /**
+ * Calls the callback once the check of whether Google Play Install API is available is done.
+ * @param packageName The package name of the WebAPK for the check.
+ * @param statusCode The error code returned by Google Play.
+ */
+ void onCanUseInstallApi(String packageName, int statusCode);
}

Powered by Google App Engine
This is Rietveld 408576698