Commit 042cad84 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

[omnibox] More correct OmniboxResultView::CalculatePreferredSize().

Even though the suggestion view and the keyword view take up the same space,
that doesn't mean the suggestion view is guaranteed to be at least as large as
the keyword view.  Use the max of the two sizes.

Bug: none
Change-Id: Ia08506e8ce2742ce09833930572c278c2ceb9909
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857652
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarKevin Bailey <krb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706241}
parent 310dbb11
...@@ -410,10 +410,10 @@ void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) { ...@@ -410,10 +410,10 @@ void OmniboxResultView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
} }
gfx::Size OmniboxResultView::CalculatePreferredSize() const { gfx::Size OmniboxResultView::CalculatePreferredSize() const {
// The keyword_view_ is not added because keyword_view_ uses the same space as gfx::Size size = suggestion_view_->GetPreferredSize();
// suggestion_view_. So the 'preferred' size is just the suggestion_view_ if (keyword_view_->GetVisible())
// size. size.SetToMax(keyword_view_->GetPreferredSize());
return suggestion_view_->CalculatePreferredSize(); return size;
} }
void OmniboxResultView::OnThemeChanged() { void OmniboxResultView::OnThemeChanged() {
......
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