| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.widget; | 5 package org.chromium.chrome.browser.widget; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.res.TypedArray; | 8 import android.content.res.TypedArray; |
| 9 import android.util.AttributeSet; | 9 import android.util.AttributeSet; |
| 10 import android.widget.LinearLayout; | 10 import android.widget.LinearLayout; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Limit width to mMaxWidth. | 44 // Limit width to mMaxWidth. |
| 45 int widthSize = MeasureSpec.getSize(widthMeasureSpec); | 45 int widthSize = MeasureSpec.getSize(widthMeasureSpec); |
| 46 if (mMaxWidth != NO_MAX_WIDTH && widthSize > mMaxWidth) { | 46 if (mMaxWidth != NO_MAX_WIDTH && widthSize > mMaxWidth) { |
| 47 int widthMode = MeasureSpec.getMode(widthMeasureSpec); | 47 int widthMode = MeasureSpec.getMode(widthMeasureSpec); |
| 48 if (widthMode == MeasureSpec.UNSPECIFIED) widthMode = MeasureSpec.AT
_MOST; | 48 if (widthMode == MeasureSpec.UNSPECIFIED) widthMode = MeasureSpec.AT
_MOST; |
| 49 widthMeasureSpec = MeasureSpec.makeMeasureSpec(mMaxWidth, widthMode)
; | 49 widthMeasureSpec = MeasureSpec.makeMeasureSpec(mMaxWidth, widthMode)
; |
| 50 } | 50 } |
| 51 super.onMeasure(widthMeasureSpec, heightMeasureSpec); | 51 super.onMeasure(widthMeasureSpec, heightMeasureSpec); |
| 52 } | 52 } |
| 53 } | 53 } |
| OLD | NEW |