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

Unified Diff: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java

Issue 2974573002: Refactor WebApkServiceConnectionManager. (Closed)
Patch Set: Call the callback on UI thread if bindService() fails. Created 3 years, 5 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/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
index 2fc1e46694f8cdc92fbab00bdff47e7cd9de9809..81158f91a9941f1c0104a6fab4081224a0d03678 100644
--- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
+++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkValidator.java
@@ -44,6 +44,17 @@ public class WebApkValidator {
private static byte[] sCommentSignedPublicKeyBytes;
private static PublicKey sCommentSignedPublicKey;
+ /** Used to notified the consumer after checking whether the current app owns the WebAPK. */
+ public abstract static class IsOwnedCheckCallback
+ implements WebApkIdentityServiceClient.CheckRuntimeHostCallback {
+ public abstract void onIsOwnedChecked(boolean isOwned);
+
+ @Override
+ public void onCheckedRuntimeHost(boolean isValid) {
+ onIsOwnedChecked(isValid);
+ }
+ }
+
/**
* Queries the PackageManager to determine whether a WebAPK can handle the URL. Ignores whether
* the user has selected a default handler for the URL and whether the default handler is the
@@ -103,6 +114,13 @@ public class WebApkValidator {
return false;
}
+ /** Checks whether the current app is the runtime host of the WebAPK asynchronously. */
pkotwicz 2017/07/14 23:20:05 Nit: "current app" -> "Chrome"
Xi Han 2017/07/17 20:45:32 Done.
+ public static void isOwnedWebApkAsync(
pkotwicz 2017/07/14 23:20:05 1) Can you please rename this method to checkChrom
Xi Han 2017/07/17 20:45:32 Done.
+ Context appContext, String webApkPackageName, IsOwnedCheckCallback callback) {
+ WebApkIdentityServiceClient.checkWebApkRuntimeHostAsync(
+ appContext, webApkPackageName, callback);
pkotwicz 2017/07/14 23:20:05 1) WebApkIdentityServiceClient#checkWebApkRuntimeH
Xi Han 2017/07/17 20:45:32 WebApkIdentityServiceClient shouldn't have browser
pkotwicz 2017/07/18 17:30:47 Fair point. In this case you can can rename the fu
+ }
+
/**
* Fetches the list of resolve infos from the PackageManager that can handle the URL.
*

Powered by Google App Engine
This is Rietveld 408576698