Skip to content

Commit

Permalink
Repair the widget size of the fullscreen permission request bubble
Browse files Browse the repository at this point in the history
This regressed in r338796 which avoided adding borders to buttons that
would immediately be replaced when the NativeTheme was set.

However, ExclusiveAccessBubbleViews is not a WidgetDelegate[View] or a
BubbleDelegate[View], so has custom preferred-sizing code. It also
removes its layout manager during construction, preventing the usual
auto-layout from being triggered when the NativeTheme is set. This means
that it performs a single layout at construction time to determine a
preferred size.

Since it was doing this before adding the view to the widget, the size
was being calculated without taking into account the NativeTheme-styled
buttons. Before r338796 it would size based on Chrome-OS style buttons
before replacing with (on Linux) GTK style buttons, which worked OK.
After r338796 this changed to a layout based on no borders.

To fix, add the view to the widget before calculating the preferred
size.

BUG=510724

Review URL: https://codereview.chromium.org/1235983005

Cr-Commit-Position: refs/heads/master@{#339351}
  • Loading branch information
tapted authored and Commit bot committed Jul 17, 2015
1 parent 167581a commit 5f4a84b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chrome/browser/ui/views/exclusive_access_bubble_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,10 @@ ExclusiveAccessBubbleViews::ExclusiveAccessBubbleViews(
params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
params.parent =
bubble_view_context_->GetBubbleAssociatedWidget()->GetNativeView();
params.bounds = GetPopupRect(false);
popup_->Init(params);
gfx::Size size = GetPopupRect(true).size();
popup_->SetContentsView(view_);
gfx::Size size = GetPopupRect(true).size();
popup_->SetBounds(GetPopupRect(false));
// We set layout manager to nullptr to prevent the widget from sizing its
// contents to the same size as itself. This prevents the widget contents from
// shrinking while we animate the height of the popup to give the impression
Expand Down

0 comments on commit 5f4a84b

Please sign in to comment.