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

Unified Diff: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.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
« no previous file with comments | « chrome/android/webapk/shell_apk/shell_apk_version.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java
diff --git a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java
index e30875d3a331c1bbdfff0a3290f591ff735ed751..6e1c64a74e4fb8ff916963b1206005d840a2bb7d 100644
--- a/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java
+++ b/chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java
@@ -92,10 +92,14 @@ public class MainActivity extends Activity {
Log.v(TAG, "Package name of the WebAPK:" + packageName);
String runtimeHost = WebApkUtils.getHostBrowserPackageName(this);
- boolean isFromExternalIntent = (overrideUrl != null);
+ boolean forceNavigation = false;
int source = getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0);
- if (isFromExternalIntent && source == WebApkConstants.SHORTCUT_SOURCE_UNKNOWN) {
- source = WebApkConstants.SHORTCUT_SOURCE_EXTERNAL_INTENT;
+ if (overrideUrl != null) {
+ if (source == WebApkConstants.SHORTCUT_SOURCE_UNKNOWN) {
+ source = WebApkConstants.SHORTCUT_SOURCE_EXTERNAL_INTENT;
+ }
+ forceNavigation = getIntent().getBooleanExtra(
+ WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION, true);
}
// The override URL is non null when the WebAPK is launched from a deep link. The WebAPK
@@ -106,7 +110,7 @@ public class MainActivity extends Activity {
intent.putExtra(WebApkConstants.EXTRA_URL, startUrl)
.putExtra(WebApkConstants.EXTRA_SOURCE, source)
.putExtra(WebApkConstants.EXTRA_WEBAPK_PACKAGE_NAME, packageName)
- .putExtra(WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION, isFromExternalIntent);
+ .putExtra(WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION, forceNavigation);
try {
startActivity(intent);
« no previous file with comments | « chrome/android/webapk/shell_apk/shell_apk_version.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698