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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java

Issue 2965233003: [Android WebAPK] Make variations only control whether WebAPKs can be installed (Closed)
Patch Set: Merge branch 'master' into chrome_webapk_host Created 3 years, 5 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/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
index e045e2117950d78b9606711aa0859aa25ad2818b..72cff49aaa183af1430505cfb777a75a485abcf0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/externalnav/ExternalNavigationHandler.java
@@ -28,7 +28,6 @@ import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabRedirectHandler;
import org.chromium.chrome.browser.util.IntentUtils;
import org.chromium.chrome.browser.util.UrlUtilities;
-import org.chromium.chrome.browser.webapps.ChromeWebApkHost;
import org.chromium.content_public.common.ContentUrlConstants;
import org.chromium.ui.base.PageTransition;
@@ -515,27 +514,24 @@ public class ExternalNavigationHandler {
IntentWithGesturesHandler.getInstance().onNewIntentWithGesture(intent);
}
- if (ChromeWebApkHost.isEnabled()) {
- // If the only specialized intent handler is a WebAPK, set the intent's package to
- // launch the WebAPK without showing the intent picker.
- String targetWebApkPackageName = mDelegate.findWebApkPackageName(resolvingInfos);
-
- // We can't rely on this falling through to startActivityIfNeeded and behaving
- // correctly for WebAPKs. This is because the target of the intent is the WebApk's
- // main activity but that's just a bouncer which will redirect to WebApkActivity in
- // chrome. To avoid bouncing indefinitely, don't override the navigation if we are
- // currently showing the WebApk |params.webApkPackageName()| that we will redirect
- // to.
- if (targetWebApkPackageName != null
- && targetWebApkPackageName.equals(params.webApkPackageName())) {
- if (DEBUG) Log.i(TAG, "NO_OVERRIDE: Navigation in WebApk");
- return OverrideUrlLoadingResult.NO_OVERRIDE;
- }
+ // If the only specialized intent handler is a WebAPK, set the intent's package to
+ // launch the WebAPK without showing the intent picker.
+ String targetWebApkPackageName = mDelegate.findWebApkPackageName(resolvingInfos);
+
+ // We can't rely on this falling through to startActivityIfNeeded and behaving
+ // correctly for WebAPKs. This is because the target of the intent is the WebApk's main
+ // activity but that's just a bouncer which will redirect to WebApkActivity in chrome.
+ // To avoid bouncing indefinitely, don't override the navigation if we are currently
+ // showing the WebApk |params.webApkPackageName()| that we will redirect to.
+ if (targetWebApkPackageName != null
+ && targetWebApkPackageName.equals(params.webApkPackageName())) {
+ if (DEBUG) Log.i(TAG, "NO_OVERRIDE: Navigation in WebApk");
+ return OverrideUrlLoadingResult.NO_OVERRIDE;
+ }
- if (targetWebApkPackageName != null
- && mDelegate.countSpecializedHandlers(resolvingInfos) == 1) {
- intent.setPackage(targetWebApkPackageName);
- }
+ if (targetWebApkPackageName != null
+ && mDelegate.countSpecializedHandlers(resolvingInfos) == 1) {
+ intent.setPackage(targetWebApkPackageName);
}
if (mDelegate.startActivityIfNeeded(intent, shouldProxyForInstantApps)) {

Powered by Google App Engine
This is Rietveld 408576698