Commit 0c15a3ce authored by David Black's avatar David Black Committed by Commit Bot

Fix regression which caused Assistant chips to shrink.

For Assistant, we use a horizontal BoxLayout which relies on
GetHeightForWidth to determine chip size. By removing this method
override we will no longer respect kPreferredHeightDip.

Screenshot in the bug.

Bug: b:117991892
Change-Id: Ic6b889a477b262290285ad5e61c3922ee43ceb6f
Reviewed-on: https://chromium-review.googlesource.com/c/1292608
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: default avatarWeidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601360}
parent 464808c9
......@@ -97,7 +97,11 @@ void SuggestionChipView::SetBackgroundBlurEnabled(bool enabled) {
gfx::Size SuggestionChipView::CalculatePreferredSize() const {
const int preferred_width = views::View::CalculatePreferredSize().width();
return gfx::Size(preferred_width, kPreferredHeightDip);
return gfx::Size(preferred_width, GetHeightForWidth(preferred_width));
}
int SuggestionChipView::GetHeightForWidth(int width) const {
return kPreferredHeightDip;
}
void SuggestionChipView::ChildVisibilityChanged(views::View* child) {
......
......@@ -47,6 +47,7 @@ class APP_LIST_EXPORT SuggestionChipView : public views::Button {
// views::View:
gfx::Size CalculatePreferredSize() const override;
int GetHeightForWidth(int width) const override;
void ChildVisibilityChanged(views::View* child) override;
void OnPaintBackground(gfx::Canvas* canvas) override;
void OnFocus() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment