Chromium Code Reviews| Index: ui/views/bubble/bubble_frame_view.cc |
| diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc |
| index 2dd002e5a7192c4fa1d47b4089a66f845eb4c08c..378e42726eb9e2f8a45cb4a47201f6058b6096fb 100644 |
| --- a/ui/views/bubble/bubble_frame_view.cc |
| +++ b/ui/views/bubble/bubble_frame_view.cc |
| @@ -132,7 +132,7 @@ Button* BubbleFrameView::CreateCloseButton(ButtonListener* listener) { |
| gfx::Rect BubbleFrameView::GetBoundsForClientView() const { |
| gfx::Rect client_bounds = GetContentsBounds(); |
| client_bounds.Inset(GetInsets()); |
| - if (footnote_container_) { |
| + if (footnote_container_ && footnote_container_->visible()) { |
| client_bounds.set_height(client_bounds.height() - |
| footnote_container_->height()); |
| } |
| @@ -340,7 +340,7 @@ void BubbleFrameView::Layout() { |
| bounds.set_width(title_->bounds().right() - bounds.x()); |
| bounds.set_height(title_height); |
| - if (footnote_container_) { |
| + if (footnote_container_ && footnote_container_->visible()) { |
| const int width = contents_bounds.width(); |
| const int height = footnote_container_->GetHeightForWidth(width); |
| footnote_container_->SetBounds( |
| @@ -416,6 +416,7 @@ void BubbleFrameView::SetFootnoteView(View* view) { |
| footnote_container_->SetBorder( |
| CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor)); |
| footnote_container_->AddChildView(view); |
| + footnote_container_->SetVisible(view->visible()); |
| AddChildView(footnote_container_); |
| } |
| @@ -541,8 +542,14 @@ gfx::Size BubbleFrameView::GetSizeForClientSize( |
| size.Enlarge(client_insets.width(), client_insets.height()); |
| size.SetToMax(gfx::Size(title_bar_width, 0)); |
| - if (footnote_container_) |
| - size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); |
| + if (footnote_container_) { |
| + if (footnote_container_->child_count() >= 1) { |
| + footnote_container_->SetVisible( |
| + footnote_container_->child_at(0)->visible()); |
|
Jared Saul
2017/06/27 21:52:26
Note for msw@/tapted@: This changing of the footno
tapted
2017/06/27 23:36:15
We need something added to bubble_frame_view_unitt
Jared Saul
2017/07/05 19:36:51
1-Unit test) Added a test "FootnoteContainerViewSh
|
| + } |
| + if (footnote_container_->visible()) |
| + size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width())); |
| + } |
| DialogDelegate* dialog_delegate = |
| GetWidget()->widget_delegate()->AsDialogDelegate(); |