part7: GetHeightForWidth default uses CalculatePreferredSize(SizeBounds)
In order to ensure implementation consistency and avoid oversights, we should unify CalculatePreferredSize() and GetHeightForWidth(). Replace them with the CalculatePreferredSize(SizeBounds) overload. Due to inconsistent implementation of CalculatePreferredSize and GetHeightForWidth. Even CalculatePreferredSize returns the wrong height. GetHeightForWidth also re-corrects it through the LayoutManager's calculations. Correct this mistake now. Because we subsequently expect to get the correct result with only one calculation. This is the purpose of our migration. Bug: 40232718 Change-Id: I780720c1719bb2216c5d8f5e24fd322167d16c77 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545357 Reviewed-by: Toni Barzic <tbarzic@chromium.org> Commit-Queue: Weidong Liu <weidongliu@chromium.org> Cr-Commit-Position: refs/heads/main@{#1302079}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
7e5ddc7e35
commit
66e40bd3dc
@ -657,7 +657,7 @@ gfx::Size SearchBoxViewBase::CalculatePreferredSize(
|
||||
.height()
|
||||
: 0;
|
||||
return gfx::Size(kSearchBoxPreferredWidth,
|
||||
kSearchBoxPreferredHeight + iph_height);
|
||||
kSearchBoxPreferredHeight + insets.height() + iph_height);
|
||||
}
|
||||
|
||||
void SearchBoxViewBase::OnEnabledChanged() {
|
||||
|
Reference in New Issue
Block a user