| Index: chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
|
| index 6702c0ee737ab9c2a4abc54788381d208ec2789b..46778e005f0f0f3e0d37fe2c5242de273d9b1b7f 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarContainer.java
|
| @@ -114,6 +114,9 @@ public class InfoBarContainer extends ScrollView {
|
| int tabId, ViewGroup parentView, WebContents webContents) {
|
| super(activity);
|
|
|
| + // Workaround for http://crbug.com/407149. See explanation in onMeasure() below.
|
| + setVerticalScrollBarEnabled(false);
|
| +
|
| FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
|
| LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
|
| int topMarginDp = DeviceFormFactor.isTablet(activity)
|
| @@ -143,6 +146,19 @@ public class InfoBarContainer extends ScrollView {
|
| mNativeInfoBarContainer = nativeInit(webContents, mAutoLoginDelegate);
|
| }
|
|
|
| + @Override
|
| + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
| + super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
| +
|
| + // Only enable scrollbars when the view is actually scrollable.
|
| + // This prevents 10-15 frames of jank that would otherwise occur 1.2 seconds after the
|
| + // InfoBarContainer is attached to the window. See: http://crbug.com/407149
|
| + boolean canScroll = mLinearLayout.getMeasuredHeight() > getMeasuredHeight();
|
| + if (canScroll != isVerticalScrollBarEnabled()) {
|
| + setVerticalScrollBarEnabled(canScroll);
|
| + }
|
| + }
|
| +
|
| /**
|
| * @return The LinearLayout that holds the infobars (i.e. the ContentWrapperViews).
|
| */
|
|
|