Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java |
index 70892c7c158d756086b6b4cbd4d965f8a015d4ef..ed20ee3d43cedd7bd8860e0a5161fd89cf293cca 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java |
@@ -10,6 +10,7 @@ import android.content.pm.PackageManager; |
import android.content.res.Resources; |
import android.graphics.Bitmap; |
import android.graphics.BitmapFactory; |
+import android.net.Uri; |
import android.os.Bundle; |
import android.text.TextUtils; |
@@ -186,6 +187,17 @@ public class WebApkInfo extends WebappInfo { |
scope = ShortcutHelper.getScopeFromUrl(manifestStartUrl); |
} |
+ // The WebAPK may have been launched as a result of an intent filter for a different scheme |
Yaron
2017/06/28 16:59:39
this is an interesting place to put it - I would'v
Yaron
2017/06/28 17:22:14
+palmer
pkotwicz
2017/06/28 20:45:06
I put the logic here because the goal is for WebAP
Yaron
2017/06/29 02:15:06
Ya, I guess I didn't really realize that atleast t
pkotwicz
2017/06/29 04:46:41
No, navigations within the WebAPK should not be re
|
+ // or top level domain. Rewrite the scheme and host name to the scope's scheme and host |
+ // name. |
+ Uri parsedUrl = Uri.parse(url); |
+ Uri parsedScope = Uri.parse(scope); |
+ url = parsedUrl.buildUpon() |
+ .scheme(parsedScope.getScheme()) |
+ .authority(parsedScope.getAuthority()) |
+ .build() |
+ .toString(); |
+ |
return new WebApkInfo(id, url, forceNavigation, scope, primaryIcon, badgeIcon, name, |
shortName, displayMode, orientation, source, themeColor, backgroundColor, |
webApkPackageName, shellApkVersion, manifestUrl, manifestStartUrl, |