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

Unified Diff: chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java

Issue 2849873002: [Android WebAPK] Don't navigate WebAPK as a result of WindowClient.focus() (Closed)
Patch Set: Merge branch 'master' into twitter Created 3 years, 7 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/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
diff --git a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
index 39e5fdb79b3d25d85759c0c8b8a299878e1ce6e8..f559c432d73e6ac2a62060cdcd2c7c90c147978b 100644
--- a/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
+++ b/chrome/android/webapk/libs/client/src/org/chromium/webapk/lib/client/WebApkNavigationClient.java
@@ -6,6 +6,8 @@ package org.chromium.webapk.lib.client;
import android.content.Intent;
+import org.chromium.webapk.lib.common.WebApkConstants;
+
/**
* WebApkNavigationClient provides an API to get an intent to launch a WebAPK.
*/
@@ -14,9 +16,13 @@ public class WebApkNavigationClient {
* Creates intent to launch a WebAPK.
* @param webApkPackageName Package name of the WebAPK to launch.
* @param url URL to navigate WebAPK to.
+ * @param forceNavigation Whether the WebAPK should be navigated to the url if the WebAPK is
+ * already open. If {@link forceNavigation} is false and the WebAPK is already running,
+ * the WebAPK will be brought to the foreground.
* @return The intent.
*/
- public static Intent createLaunchWebApkIntent(String webApkPackageName, String url) {
+ public static Intent createLaunchWebApkIntent(
+ String webApkPackageName, String url, boolean forceNavigation) {
Intent intent;
try {
intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
@@ -26,6 +32,7 @@ public class WebApkNavigationClient {
intent.setPackage(webApkPackageName);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.putExtra(WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION, forceNavigation);
return intent;
}
}

Powered by Google App Engine
This is Rietveld 408576698