| Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateDataFetcher.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateDataFetcher.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateDataFetcher.java
|
| index 5b50aa0c6a1907276204b1fa56f4e5d2906349a7..336d061d82aa94e3e048d84d80fae70fa9409bb7 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateDataFetcher.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateDataFetcher.java
|
| @@ -30,11 +30,12 @@ public class WebApkUpdateDataFetcher extends EmptyTabObserver {
|
| /**
|
| * Called when the Web Manifest has been successfully fetched (including on the initial URL
|
| * load).
|
| - * @param fetchedInfo The fetched Web Manifest data.
|
| - * @param bestIconUrl The icon URL in {@link fetchedInfo#iconUrlToMurmur2HashMap()} best
|
| - * suited for use as the launcher icon on this device.
|
| + *
|
| + * @param fetchedInfo The fetched Web Manifest data.
|
| + * @param bestPrimaryIconUrl The icon URL in {@link fetchedInfo#iconUrlToMurmur2HashMap()}
|
| + * best suited for use as the launcher icon on this device.
|
| */
|
| - void onGotManifestData(WebApkInfo fetchedInfo, String bestIconUrl);
|
| + void onGotManifestData(WebApkInfo fetchedInfo, String bestPrimaryIconUrl);
|
| }
|
|
|
| /**
|
| @@ -99,26 +100,29 @@ public class WebApkUpdateDataFetcher extends EmptyTabObserver {
|
| */
|
| @CalledByNative
|
| protected void onDataAvailable(String manifestStartUrl, String scopeUrl, String name,
|
| - String shortName, String bestIconUrl, String bestIconMurmur2Hash, Bitmap bestIconBitmap,
|
| + String shortName, String bestPrimaryIconUrl, String bestPrimaryIconMurmur2Hash,
|
| + Bitmap bestPrimaryIconBitmap,
|
| String[] iconUrls, int displayMode, int orientation, long themeColor,
|
| long backgroundColor) {
|
| HashMap<String, String> iconUrlToMurmur2HashMap = new HashMap<String, String>();
|
| for (String iconUrl : iconUrls) {
|
| - String murmur2Hash = (iconUrl.equals(bestIconUrl)) ? bestIconMurmur2Hash : null;
|
| + String murmur2Hash = (iconUrl.equals(bestPrimaryIconUrl)) ? bestPrimaryIconMurmur2Hash
|
| + : null;
|
| iconUrlToMurmur2HashMap.put(iconUrl, murmur2Hash);
|
| }
|
|
|
| WebApkInfo info = WebApkInfo.create(mOldInfo.id(), mOldInfo.uri().toString(), scopeUrl,
|
| - new WebApkInfo.Icon(bestIconBitmap), name, shortName, displayMode, orientation,
|
| + new WebApkInfo.Icon(bestPrimaryIconBitmap), name, shortName, displayMode,
|
| + orientation,
|
| mOldInfo.source(), themeColor, backgroundColor, mOldInfo.webApkPackageName(),
|
| mOldInfo.shellApkVersion(), mOldInfo.manifestUrl(), manifestStartUrl,
|
| iconUrlToMurmur2HashMap);
|
| - mObserver.onGotManifestData(info, bestIconUrl);
|
| + mObserver.onGotManifestData(info, bestPrimaryIconUrl);
|
| }
|
|
|
| /**
|
| - * Called when the initial URL load has completed and the page has no Web Manifest or the
|
| - * Web Manifest is not WebAPK compatible.
|
| + * Called when the initial URL load has completed and the page has no Web Manifest or the Web
|
| + * Manifest is not WebAPK compatible.
|
| */
|
| @CalledByNative
|
| private void onWebManifestForInitialUrlNotWebApkCompatible() {
|
| @@ -126,8 +130,11 @@ public class WebApkUpdateDataFetcher extends EmptyTabObserver {
|
| }
|
|
|
| private native long nativeInitialize(String scope, String webManifestUrl);
|
| +
|
| private native void nativeReplaceWebContents(
|
| long nativeWebApkUpdateDataFetcher, WebContents webContents);
|
| +
|
| private native void nativeDestroy(long nativeWebApkUpdateDataFetcher);
|
| +
|
| private native void nativeStart(long nativeWebApkUpdateDataFetcher, WebContents webContents);
|
| }
|
|
|