Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| index cbe92b54be1300b6dede26246975b74711c82e41..b26e3abe8050908a29f658f81a09632146fccfc4 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| @@ -22,11 +22,9 @@ import android.os.Build; |
| import android.os.Bundle; |
| import android.os.StrictMode; |
| import android.os.SystemClock; |
| -import android.support.design.widget.CoordinatorLayout.LayoutParams; |
| import android.support.v7.app.AlertDialog; |
| import android.util.DisplayMetrics; |
| import android.util.Pair; |
| -import android.view.Gravity; |
| import android.view.Menu; |
| import android.view.MenuItem; |
| import android.view.View; |
| @@ -127,6 +125,7 @@ import org.chromium.chrome.browser.util.ChromeFileProvider; |
| import org.chromium.chrome.browser.util.ColorUtils; |
| import org.chromium.chrome.browser.util.FeatureUtilities; |
| import org.chromium.chrome.browser.webapps.AddToHomescreenManager; |
| +import org.chromium.chrome.browser.widget.BottomSheet; |
| import org.chromium.chrome.browser.widget.ControlContainer; |
| import org.chromium.components.bookmarks.BookmarkId; |
| import org.chromium.content.browser.ContentVideoView; |
| @@ -357,6 +356,7 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| enableHardwareAcceleration(); |
| setLowEndTheme(); |
| + ControlContainer controlContainer = null; |
|
Ian Wen
2017/01/17 18:39:47
Why this line? IIUC you are not using the variable
mdjones
2017/01/17 21:29:45
Code was previously more spread out, fixed.
|
| int controlContainerLayoutId = getControlContainerLayoutId(); |
| WarmupManager warmupManager = WarmupManager.getInstance(); |
| if (warmupManager.hasViewHierarchyWithToolbar(controlContainerLayoutId)) { |
| @@ -380,19 +380,18 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| toolbarContainerStub.setLayoutResource(controlContainerLayoutId); |
| View container = toolbarContainerStub.inflate(); |
| - |
| - // If the control container is at the bottom apply Gravity.BOTTOM here since |
| - // it is not respected in the XML while the ViewStub in between the |
| - // CompositorViewHolder and ControlContainer. |
| - if (controlContainerLayoutId == R.layout.bottom_control_container) { |
| - ((LayoutParams) container.getLayoutParams()).gravity = Gravity.BOTTOM; |
| - } |
| } |
| // It cannot be assumed that the result of toolbarContainerStub.inflate() will be |
| // the control container since it may be wrapped in another view. |
| - ControlContainer controlContainer = |
| - (ControlContainer) findViewById(R.id.control_container); |
| + controlContainer = (ControlContainer) findViewById(R.id.control_container); |
| + |
| + // Get a handle to the bottom sheet if using the bottom control container. |
| + if (controlContainerLayoutId == R.layout.bottom_control_container) { |
| + View coordinator = findViewById(R.id.coordinator); |
| + BottomSheet bottomSheet = (BottomSheet) findViewById(R.id.bottom_sheet); |
| + bottomSheet.init(coordinator, controlContainer.getView()); |
| + } |
| // Inflate the correct toolbar layout for the device. |
| int toolbarLayoutId = getToolbarLayoutId(); |