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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.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/CustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index 8fb9fc71760c5802e5324e9e88ea5ff91aa77938..20c8cd28cc90f3ce882345c2d8e3fba11140e9fc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -49,7 +49,7 @@ import org.chromium.chrome.browser.compositor.layouts.LayoutManagerDocument;
import org.chromium.chrome.browser.datausage.DataUseTabUIManager;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
import org.chromium.chrome.browser.externalnav.ExternalNavigationDelegateImpl;
-import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager;
+import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibilityDelegate;
import org.chromium.chrome.browser.metrics.PageLoadMetrics;
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
import org.chromium.chrome.browser.pageinfo.WebsiteSettingsPopup;
@@ -141,6 +141,7 @@ public class CustomTabActivity extends ChromeActivity {
private static class CustomTabCreator extends ChromeTabCreator {
private final boolean mSupportsUrlBarHiding;
private final boolean mIsOpenedByChrome;
+ private final BrowserStateBrowserControlsVisibilityDelegate mVisibilityDelegate;
public CustomTabCreator(
ChromeActivity activity, WindowAndroid nativeWindow, boolean incognito,
@@ -148,11 +149,13 @@ public class CustomTabActivity extends ChromeActivity {
super(activity, nativeWindow, incognito);
mSupportsUrlBarHiding = supportsUrlBarHiding;
mIsOpenedByChrome = isOpenedByChrome;
+ mVisibilityDelegate = activity.getFullscreenManager().getBrowserVisibilityDelegate();
}
@Override
public TabDelegateFactory createDefaultTabDelegateFactory() {
- return new CustomTabDelegateFactory(mSupportsUrlBarHiding, mIsOpenedByChrome);
+ return new CustomTabDelegateFactory(
+ mSupportsUrlBarHiding, mIsOpenedByChrome, mVisibilityDelegate);
}
}
@@ -399,7 +402,9 @@ public class CustomTabActivity extends ChromeActivity {
if (getContextualSearchManager() != null) {
getContextualSearchManager().setFindToolbarManager(mFindToolbarManager);
}
- getToolbarManager().initializeWithNative(getTabModelSelector(), getFullscreenManager(),
+ getToolbarManager().initializeWithNative(
+ getTabModelSelector(),
+ getFullscreenManager().getBrowserVisibilityDelegate(),
mFindToolbarManager, null, layoutDriver, null, null, null,
new OnClickListener() {
@Override
@@ -515,7 +520,8 @@ public class CustomTabActivity extends ChromeActivity {
webContents, getTabContentManager(),
new CustomTabDelegateFactory(
mIntentDataProvider.shouldEnableUrlBarHiding(),
- mIntentDataProvider.isOpenedByChrome()),
+ mIntentDataProvider.isOpenedByChrome(),
+ getFullscreenManager().getBrowserVisibilityDelegate()),
false, false);
initializeMainTab(tab);
return tab;
@@ -920,13 +926,6 @@ public class CustomTabActivity extends ChromeActivity {
return url;
}
- @Override
- protected ChromeFullscreenManager createFullscreenManager() {
- return new ChromeFullscreenManager(this,
- (ToolbarControlContainer) findViewById(R.id.control_container),
- getTabModelSelector(), getControlContainerHeightResource(), true, false);
- }
-
/** Sets the initial background color for the Tab, shown before the page content is ready. */
private void prepareTabBackground(final Tab tab) {
if (!IntentHandler.isIntentChromeOrFirstParty(getIntent(), this)) return;

Powered by Google App Engine
This is Rietveld 408576698