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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java

Issue 2643853004: Launch WebAPK in regular browser if user disables WebAPKs in chrome://flags (Closed)
Patch Set: Merge branch 'master' into webapk_disabled Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
index 238a873d98f2cb302112bfffa087188b2a8da5f1..64906a676c9cfc65600c40023b17160cce71b088 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
@@ -62,7 +62,11 @@ public class WebappLauncherActivity extends Activity {
// {@link WebApkInfo#create()} and {@link WebappInfo#create()} return null if the intent
// does not specify required values such as the uri.
- if (webappInfo == null) return;
+ if (webappInfo == null) {
+ String url = IntentUtils.safeGetStringExtra(intent, ShortcutHelper.EXTRA_URL);
+ launchInTab(url, ShortcutSource.UNKNOWN);
+ return;
+ }
String webappUrl = webappInfo.uri().toString();
int webappSource = webappInfo.source();
@@ -84,6 +88,12 @@ public class WebappLauncherActivity extends Activity {
// The shortcut data doesn't match the current encoding. Change the intent action to
// launch the URL with a VIEW Intent in the regular browser.
+ launchInTab(webappUrl, webappSource);
+ }
+
+ private void launchInTab(String webappUrl, int webappSource) {
+ if (TextUtils.isEmpty(webappUrl)) return;
+
Intent launchIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(webappUrl));
launchIntent.setClassName(getPackageName(), ChromeLauncherActivity.class.getName());
launchIntent.putExtra(ShortcutHelper.REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB, true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698