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

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

Issue 2484293003: Use only renderer driven offsets for fullscreen state. (Closed)
Patch Set: Partially disable testControlsShownOnUnresponsiveRenderer due to timing issues with renderer logic … Created 4 years, 1 month 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 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

Powered by Google App Engine
This is Rietveld 408576698