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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java

Issue 2411903003: Fix tab redirect to apps in Herb mode. (Closed)
Patch Set: Created 4 years, 2 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/customtabs/CustomTabDelegateFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
index 690cc6c80ebd13f47793b4166dfe400f85d1a1b3..ad6844d5780f90aed0c6574842355875d0ecce8b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabDelegateFactory.java
@@ -139,15 +139,18 @@ public class CustomTabDelegateFactory extends TabDelegateFactory {
}
}
- private CustomTabNavigationDelegate mNavigationDelegate;
+ private final boolean mShouldHideTopControls;
+ private final boolean mIsOpenedByChrome;
+
+ private ExternalNavigationDelegateImpl mNavigationDelegate;
private ExternalNavigationHandler mNavigationHandler;
- private boolean mShouldHideTopControls;
/**
* @param shouldHideTopControls Whether or not the top controls may auto-hide.
*/
- public CustomTabDelegateFactory(boolean shouldHideTopControls) {
+ public CustomTabDelegateFactory(boolean shouldHideTopControls, boolean isOpenedByChrome) {
mShouldHideTopControls = shouldHideTopControls;
+ mIsOpenedByChrome = isOpenedByChrome;
}
@Override
@@ -167,7 +170,11 @@ public class CustomTabDelegateFactory extends TabDelegateFactory {
@Override
public InterceptNavigationDelegateImpl createInterceptNavigationDelegate(Tab tab) {
- mNavigationDelegate = new CustomTabNavigationDelegate(tab, tab.getAppAssociatedWith());
+ if (mIsOpenedByChrome) {
+ mNavigationDelegate = new ExternalNavigationDelegateImpl(tab);
+ } else {
+ mNavigationDelegate = new CustomTabNavigationDelegate(tab, tab.getAppAssociatedWith());
+ }
mNavigationHandler = new ExternalNavigationHandler(mNavigationDelegate);
return new InterceptNavigationDelegateImpl(mNavigationHandler, tab);
}
@@ -190,7 +197,7 @@ public class CustomTabDelegateFactory extends TabDelegateFactory {
* @return The {@link CustomTabNavigationDelegate} in this tab. For test purpose only.
*/
@VisibleForTesting
- CustomTabNavigationDelegate getExternalNavigationDelegate() {
+ ExternalNavigationDelegateImpl getExternalNavigationDelegate() {
return mNavigationDelegate;
}

Powered by Google App Engine
This is Rietveld 408576698