| 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 95cd066613d967cd51fd906223f9eef5cb352404..6affcd365fdaab2855abde4f70d167807d1395b4 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
|
| @@ -15,11 +15,14 @@ import org.chromium.chrome.browser.contextmenu.ChromeContextMenuPopulator;
|
| import org.chromium.chrome.browser.contextmenu.ContextMenuPopulator;
|
| import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl;
|
| import org.chromium.chrome.browser.externalnav.ExternalNavigationHandler;
|
| +import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate;
|
| +import org.chromium.chrome.browser.fullscreen.ComposedBrowserControlsVisibilityDelegate;
|
| import org.chromium.chrome.browser.tab.BrowserControlsVisibilityDelegate;
|
| import org.chromium.chrome.browser.tab.InterceptNavigationDelegateImpl;
|
| import org.chromium.chrome.browser.tab.Tab;
|
| import org.chromium.chrome.browser.tab.TabContextMenuItemDelegate;
|
| import org.chromium.chrome.browser.tab.TabDelegateFactory;
|
| +import org.chromium.chrome.browser.tab.TabStateBrowserControlsVisibilityDelegate;
|
| import org.chromium.chrome.browser.tab.TabWebContentsDelegateAndroid;
|
| import org.chromium.chrome.browser.util.IntentUtils;
|
| import org.chromium.chrome.browser.util.UrlUtilities;
|
| @@ -138,26 +141,34 @@ public class CustomTabDelegateFactory extends TabDelegateFactory {
|
|
|
| private final boolean mShouldHideBrowserControls;
|
| private final boolean mIsOpenedByChrome;
|
| + private final BrowserStateBrowserControlsVisibilityDelegate mBrowserStateVisibilityDelegate;
|
|
|
| private ExternalNavigationDelegateImpl mNavigationDelegate;
|
| private ExternalNavigationHandler mNavigationHandler;
|
|
|
| /**
|
| * @param shouldHideBrowserControls Whether or not the browser controls may auto-hide.
|
| + * @param isOpenedByChrome Whether the CustomTab was originally opened by Chrome.
|
| + * @param visibilityDelegate The delegate that handles browser control visibility associated
|
| + * with browser actions (as opposed to tab state).
|
| */
|
| - public CustomTabDelegateFactory(boolean shouldHideBrowserControls, boolean isOpenedByChrome) {
|
| + public CustomTabDelegateFactory(boolean shouldHideBrowserControls, boolean isOpenedByChrome,
|
| + BrowserStateBrowserControlsVisibilityDelegate visibilityDelegate) {
|
| mShouldHideBrowserControls = shouldHideBrowserControls;
|
| mIsOpenedByChrome = isOpenedByChrome;
|
| + mBrowserStateVisibilityDelegate = visibilityDelegate;
|
| }
|
|
|
| @Override
|
| public BrowserControlsVisibilityDelegate createBrowserControlsVisibilityDelegate(Tab tab) {
|
| - return new BrowserControlsVisibilityDelegate(tab) {
|
| - @Override
|
| - public boolean isHidingBrowserControlsEnabled() {
|
| - return mShouldHideBrowserControls && super.isHidingBrowserControlsEnabled();
|
| - }
|
| - };
|
| + return new ComposedBrowserControlsVisibilityDelegate(
|
| + new TabStateBrowserControlsVisibilityDelegate(tab) {
|
| + @Override
|
| + public boolean isHidingBrowserControlsEnabled() {
|
| + return mShouldHideBrowserControls && super.isHidingBrowserControlsEnabled();
|
| + }
|
| + },
|
| + mBrowserStateVisibilityDelegate);
|
| }
|
|
|
| @Override
|
|
|