Commit f06b2aab authored by Artur Kochowski's avatar Artur Kochowski Committed by Commit Bot

Changed preferred size calculation for PageInfoBubbleView

Calculation was using only the height part of preferred size while
ignoring the width. Depending on situation this might have caused
method to return size that was either too small or too big. There is no
visible bug in Chromium because this method is called multiple times
and width returned from CalculatePreferredSize is later set to be the
same value.

Change-Id: I573ea709bb2f3fdadaa36cf71e8bddbe80ec3f32
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2056823Reviewed-by: default avatarEmily Stark <estark@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#743069}
parent 4ca4efac
...@@ -585,13 +585,12 @@ gfx::Size PageInfoBubbleView::CalculatePreferredSize() const { ...@@ -585,13 +585,12 @@ gfx::Size PageInfoBubbleView::CalculatePreferredSize() const {
return views::View::CalculatePreferredSize(); return views::View::CalculatePreferredSize();
} }
int height = views::View::CalculatePreferredSize().height();
int width = kMinBubbleWidth; int width = kMinBubbleWidth;
if (site_settings_view_) { if (site_settings_view_) {
width = std::max(width, permissions_view_->GetPreferredSize().width()); width = std::max(width, permissions_view_->GetPreferredSize().width());
width = std::min(width, kMaxBubbleWidth);
} }
width = std::min(width, kMaxBubbleWidth); return gfx::Size(width, views::View::GetHeightForWidth(width));
return gfx::Size(width, height);
} }
void PageInfoBubbleView::SetCookieInfo(const CookieInfoList& cookie_info_list) { void PageInfoBubbleView::SetCookieInfo(const CookieInfoList& cookie_info_list) {
......
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