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 50ee188790495b72ce8d43137a0c104d7816a498..b585acf56af46f141c053d5892be3e44e50f4d68 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 |
@@ -52,10 +52,20 @@ public class WebApkInfo extends WebappInfo { |
if (TextUtils.isEmpty(webApkPackageName)) { |
return null; |
} |
dominickn
2017/01/23 00:48:07
Nit: don't remove this newline
gonzalon
2017/01/23 16:58:51
Done.
|
- |
String url = urlFromIntent(intent); |
int source = sourceFromIntent(intent); |
+ return create(webApkPackageName, url, source); |
+ } |
+ /** |
+ * Constructs a WebApkInfo from the passed in parameters and <meta-data> in the WebAPK's Android |
+ * manifest. |
+ * |
+ * @param webApkPackageName The package name of the WebAPK. |
+ * @param url Url that the WebAPK should navigate to when launched. |
+ * @param source Source that the WebAPK was launched from. |
+ */ |
+ public static WebApkInfo create(String webApkPackageName, String url, int source) { |
// Unlike non-WebAPK web apps, WebAPK ids are predictable. A malicious actor may send an |
// intent with a valid start URL and arbitrary other data. Only use the start URL, the |
// package name and the ShortcutSource from the launch intent and extract the remaining data |