| 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);
|
|
|