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

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

Issue 1525793005: Move Tab's top controls visibility to a delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 29b199689fc2f5d83292786a86fb3224a406f85c..b15d70ec8a864ad4c97235a66c6ea3bf19d63a43 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
@@ -37,6 +37,7 @@ import org.chromium.chrome.browser.datausage.DataUseTabUIManager;
import org.chromium.chrome.browser.rappor.RapporServiceBridge;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabIdManager;
+import org.chromium.chrome.browser.tab.TopControlsVisibilityDelegate;
import org.chromium.chrome.browser.tabmodel.SingleTabModelSelector;
import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType;
import org.chromium.chrome.browser.toolbar.ToolbarControlContainer;
@@ -249,14 +250,7 @@ public class CustomTabActivity extends ChromeActivity {
}
mTab = new Tab(TabIdManager.getInstance().generateValidId(Tab.INVALID_TAB_ID),
Tab.INVALID_TAB_ID, false, this, getWindowAndroid(),
- TabLaunchType.FROM_EXTERNAL_APP, null, null) {
- @Override
- protected boolean isHidingTopControlsEnabled() {
- // TODO(yusufo) : Get rid of this call once all other Tab classes are removed.
- return mIntentDataProvider.shouldEnableUrlBarHiding()
- && super.isHidingTopControlsEnabled();
- }
- };
+ TabLaunchType.FROM_EXTERNAL_APP, null, null);
CustomTabsConnection customTabsConnection =
CustomTabsConnection.getInstance(getApplication());
WebContents webContents =
@@ -270,7 +264,18 @@ public class CustomTabActivity extends ChromeActivity {
webContents = WebContentsFactory.createWebContents(false, false);
}
mTab.initialize(webContents, getTabContentManager(),
- new CustomTabDelegateFactory(getApplication(), mSession), false, false);
+ new CustomTabDelegateFactory() {
+ @Override
gone 2015/12/16 21:58:10 nit: indentation is screwed up
Yusuf 2015/12/16 22:14:34 Done.
+ public TopControlsVisibilityDelegate createTopControlsVisibilityDelegate(Tab tab) {
+ return new TopControlsVisibilityDelegate(tab) {
+ @Override
+ public boolean isHidingTopControlsEnabled() {
+ return mIntentDataProvider.shouldEnableUrlBarHiding()
+ && super.isHidingTopControlsEnabled();
+ }
+ };
+ }
+ }, false, false);
mTab.getView().requestFocus();
mTabObserver = new CustomTabObserver(getApplication(), mSession);
mTab.addObserver(mTabObserver);

Powered by Google App Engine
This is Rietveld 408576698