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

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

Issue 2263673003: Pass icon and icon murmur2 hash to WebApkInstaller when updating WebAPKs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkotwicz@'s comments. Created 4 years, 4 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/ManifestUpgradeDetector.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetector.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetector.java
index 8ad99bb499af16f15ed601803893e7b33efb8fed..044290ebc54c7b4d4ed5c6056f068cbd5b75ea29 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetector.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetector.java
@@ -24,10 +24,8 @@ public class ManifestUpgradeDetector implements ManifestUpgradeDetectorFetcher.C
/**
* Called when the process of checking Web Manifest update is complete.
*/
- interface Callback {
- // TODO(hanxi): crbug.com/639000. Pass the icon url and icon murmur2 hash to the caller.
- // Change the interface by using {@link FetchedManifestData} instead of {@link WebappInfo}.
- public void onUpgradeNeededCheckFinished(boolean isUpgraded, WebappInfo newInfo);
+ public interface Callback {
+ public void onUpgradeNeededCheckFinished(boolean isUpgraded, FetchedManifestData data);
}
private static final String TAG = "cr_UpgradeDetector";
@@ -35,7 +33,7 @@ public class ManifestUpgradeDetector implements ManifestUpgradeDetectorFetcher.C
/**
* Fetched Web Manifest data.
*/
- private static class FetchedManifestData {
+ public static class FetchedManifestData {
public String startUrl;
public String scopeUrl;
public String name;
@@ -101,6 +99,10 @@ public class ManifestUpgradeDetector implements ManifestUpgradeDetectorFetcher.C
return mManifestUrl;
}
+ public String getWebApkPackageName() {
+ return mWebappInfo.webApkPackageName();
+ }
+
/**
* Starts fetching the web manifest resources.
*/
@@ -176,17 +178,10 @@ public class ManifestUpgradeDetector implements ManifestUpgradeDetectorFetcher.C
fetchedData.themeColor = themeColor;
fetchedData.backgroundColor = backgroundColor;
- // TODO(hanxi): crbug.com/627824. Validate whether the new WebappInfo is
+ // TODO(hanxi): crbug.com/627824. Validate whether the new fetched data is
// WebAPK-compatible.
boolean upgradeRequired = requireUpgrade(fetchedData);
- WebappInfo newInfo = null;
- if (upgradeRequired) {
- newInfo = WebappInfo.create(mWebappInfo.id(), startUrl, scopeUrl,
- "", name, shortName, displayMode, orientation,
- mWebappInfo.source(), themeColor, backgroundColor,
- mWebappInfo.isIconGenerated(), mWebappInfo.webApkPackageName());
- }
- mCallback.onUpgradeNeededCheckFinished(upgradeRequired, newInfo);
+ mCallback.onUpgradeNeededCheckFinished(upgradeRequired, fetchedData);
}
/**

Powered by Google App Engine
This is Rietveld 408576698