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

Unified Diff: chrome/android/webapk/shell_apk/src/org/chromium/webapk/shell_apk/MainActivity.java

Issue 2790873002: Add external intents for WebAPKs to Launch.HomescreenSource. (Closed)
Patch Set: D'oh Created 3 years, 8 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') | chrome/browser/android/shortcut_info.h » ('j') | 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 5a0b7d4ad695cdde432daec0b660ab4e1c15195f..e30875d3a331c1bbdfff0a3290f591ff735ed751 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,7 +92,11 @@ public class MainActivity extends Activity {
Log.v(TAG, "Package name of the WebAPK:" + packageName);
String runtimeHost = WebApkUtils.getHostBrowserPackageName(this);
+ boolean isFromExternalIntent = (overrideUrl != null);
int source = getIntent().getIntExtra(WebApkConstants.EXTRA_SOURCE, 0);
+ if (isFromExternalIntent && source == WebApkConstants.SHORTCUT_SOURCE_UNKNOWN) {
+ source = WebApkConstants.SHORTCUT_SOURCE_EXTERNAL_INTENT;
+ }
// The override URL is non null when the WebAPK is launched from a deep link. The WebAPK
// should navigate to the URL in the deep link even if the WebAPK is already open.
@@ -102,7 +106,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, (overrideUrl != null));
+ .putExtra(WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION, isFromExternalIntent);
try {
startActivity(intent);
« no previous file with comments | « chrome/android/webapk/shell_apk/shell_apk_version.gni ('k') | chrome/browser/android/shortcut_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698