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

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: Rebase. 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java » ('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/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 73191466f068b5ff17b4a38be77a5cb5cda77817..46d7afbfd87abc3f367f8cd556f32907b9841b2b 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
@@ -22,10 +22,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";
@@ -33,7 +31,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;
@@ -108,6 +106,10 @@ public class ManifestUpgradeDetector implements ManifestUpgradeDetectorFetcher.C
return mManifestUrl;
}
+ public String getWebApkPackageName() {
+ return mWebappInfo.webApkPackageName();
+ }
+
/**
* Starts fetching the web manifest resources.
*/
@@ -175,17 +177,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);
}
/**
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698