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

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

Issue 2727483002: Instant Apps: refactor logic to encapsulate in the Instant Apps Handler. (Closed)
Patch Set: Fix findbugs issue. Created 3 years, 10 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 afdc895ae431997e42f2aebc3551cb2af49dfa91..ef2a3af16c99a58e4a13b0d99bdb3990ecf946bf 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
@@ -59,14 +59,6 @@ public class ExternalNavigationHandler {
@VisibleForTesting
static final String EXTRA_BROWSER_FALLBACK_URL = "browser_fallback_url";
- @VisibleForTesting
- static final String SUPERVISOR_PKG = "com.google.android.instantapps.supervisor";
- @VisibleForTesting
- static final String[] SUPERVISOR_START_ACTIONS = {
- "com.google.android.instantapps.START",
- "com.google.android.instantapps.nmr1.INSTALL",
- "com.google.android.instantapps.nmr1.VIEW" };
-
// An extra that may be specified on an intent:// URL that contains an encoded value for the
// referrer field passed to the market:// URL in the case where the app is not present.
@VisibleForTesting
@@ -470,7 +462,8 @@ public class ExternalNavigationHandler {
}
}
- boolean isDirectInstantAppsIntent = isExternalProtocol && isIntentToInstantApp(intent);
+ boolean isDirectInstantAppsIntent =
+ isExternalProtocol && InstantAppsHandler.isIntentToInstantApp(intent);
boolean shouldProxyForInstantApps = isDirectInstantAppsIntent
&& mDelegate.isSerpReferrer(params.getTab());
if (shouldProxyForInstantApps) {
@@ -593,23 +586,6 @@ public class ExternalNavigationHandler {
}
/**
- * Checks whether {@param intent} is for an Instant App. Considers both package and actions that
- * would resolve to Supervisor.
- * @return Whether the given intent is going to open an Instant App.
- */
- private boolean isIntentToInstantApp(Intent intent) {
- if (SUPERVISOR_PKG.equals(intent.getPackage())) return true;
-
- String intentAction = intent.getAction();
- for (String action: SUPERVISOR_START_ACTIONS) {
- if (action.equals(intentAction)) {
- return true;
- }
- }
- return false;
- }
-
- /**
* Clobber the current tab with fallback URL.
*
* @param browserFallbackUrl The fallback URL.

Powered by Google App Engine
This is Rietveld 408576698