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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/TabRedirectHandler.java

Issue 2057933002: [Custom Tabs] Navigate to other apps if the first url is a redirect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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/tab/TabRedirectHandler.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabRedirectHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabRedirectHandler.java
index 705258cae96601356d1c8272795accb720ac38be..c65b17552a230a51194b50edd827248164df616b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabRedirectHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabRedirectHandler.java
@@ -12,6 +12,7 @@ import android.os.SystemClock;
import android.provider.Browser;
import android.text.TextUtils;
+import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.chrome.browser.util.IntentUtils;
import org.chromium.ui.base.PageTransition;
@@ -40,6 +41,7 @@ public class TabRedirectHandler {
// A resolver list which includes all resolvers of |mInitialIntent|.
private final HashSet<ComponentName> mCachedResolvers = new HashSet<ComponentName>();
private boolean mIsInitialIntentHeadingToChrome;
+ private boolean mIsCustomTabIntent;
private long mLastNewUrlLoadingTime = INVALID_TIME;
private boolean mIsOnEffectiveRedirectChain;
@@ -76,6 +78,7 @@ public class TabRedirectHandler {
Browser.EXTRA_APPLICATION_ID))) {
mIsInitialIntentHeadingToChrome = true;
}
+ mIsCustomTabIntent = ChromeLauncherActivity.isCustomTabIntent(intent);
// Copies minimum information to retrieve resolvers.
mInitialIntent = new Intent(Intent.ACTION_VIEW);
@@ -89,6 +92,7 @@ public class TabRedirectHandler {
private void clearIntentHistory() {
mIsInitialIntentHeadingToChrome = false;
+ mIsCustomTabIntent = false;
mInitialIntent = null;
mCachedResolvers.clear();
}
@@ -190,6 +194,13 @@ public class TabRedirectHandler {
}
/**
+ * @return Whether this navigation is initiated by a Custom Tabs {@link Intent}.
+ */
+ public boolean isFromCustomTabIntent() {
+ return mIsCustomTabIntent;
+ }
+
+ /**
* @return whether navigation is from a user's typing or not.
*/
public boolean isNavigationFromUserTyping() {

Powered by Google App Engine
This is Rietveld 408576698