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

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

Issue 2331773002: Take Murmur2 hash of untransformed icon when creating WebAPK part 2/2 (Closed)
Patch Set: Created 4 years, 3 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/ManifestUpgradeDetectorFetcher.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java
index dc1e57599530887a4deb666453dbf4b1768c68f3..bc2e89fa125348c6470b21bd268f17f47b01e9aa 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/ManifestUpgradeDetectorFetcher.java
@@ -18,12 +18,15 @@ import org.chromium.content_public.browser.WebContents;
public class ManifestUpgradeDetectorFetcher extends EmptyTabObserver {
/**
- * Called once the Web Manifest has been downloaded.
+ * Called once the Web Manifest has been downloaded. The callback is selected based on whether
+ * the downloaded Web Manifest is WebAPK compatible.
*/
public interface Callback {
- public void onGotManifestData(String startUrl, String scopeUrl, String name,
- String shortName, String iconUrl, long iconMurmur2Hash, Bitmap iconBitmap,
- int displayMode, int orientation, long themeColor, long backgroundColor);
+ void onGotManifestData(String startUrl, String scopeUrl, String name, String shortName,
+ String iconUrl, String iconMurmur2Hash, Bitmap iconBitmap, int displayMode,
+ int orientation, long themeColor, long backgroundColor);
+
+ void onGotNonWebApkCompatibleManifest();
}
/**
@@ -82,16 +85,26 @@ public class ManifestUpgradeDetectorFetcher extends EmptyTabObserver {
}
/**
- * Called when the updated Web Manifest has been fetched.
+ * Called when the updated Web Manifest has been fetched and the updated Web Manifest is WebAPK
+ * compatible.
*/
@CalledByNative
- private void onDataAvailable(String startUrl, String scopeUrl, String name, String shortName,
- String iconUrl, long iconMurmur2Hash, Bitmap iconBitmap, int displayMode,
- int orientation, long themeColor, long backgroundColor) {
+ private void onGotWebApkCompatibleManifest(String startUrl, String scopeUrl, String name,
+ String shortName, String iconUrl, String iconMurmur2Hash, Bitmap iconBitmap,
+ int displayMode, int orientation, long themeColor, long backgroundColor) {
mCallback.onGotManifestData(startUrl, scopeUrl, name, shortName, iconUrl, iconMurmur2Hash,
iconBitmap, displayMode, orientation, themeColor, backgroundColor);
}
+ /**
+ * Called when the updated Web Manifest has been fetched but the updated Web Manifest is not
+ * WebAPK compatible.
+ */
+ @CalledByNative
+ private void onGotNonWebApkCompatibleManifest() {
+ mCallback.onGotNonWebApkCompatibleManifest();
+ }
+
private native long nativeInitialize(String scope, String webManifestUrl);
private native void nativeReplaceWebContents(
long nativeManifestUpgradeDetectorFetcher, WebContents webContents);

Powered by Google App Engine
This is Rietveld 408576698