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 c97fcf3eacc14dc428e4629fb94da1bcd6c5416a..6e0fae7409357bd7030681cef5c191e0d6ae9154 100644 |
| --- a/ui/views/bubble/bubble_frame_view.cc |
| +++ b/ui/views/bubble/bubble_frame_view.cc |
| @@ -363,6 +363,17 @@ void BubbleFrameView::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
| } |
| } |
| +void BubbleFrameView::ViewHierarchyChanged( |
| + const ViewHierarchyChangedDetails& details) { |
| + if (!details.is_add && details.parent == footnote_container_) { |
|
sky
2017/05/24 00:03:35
Combine these two ifs into 1. Also, add a comment
mrefaat1
2017/05/24 02:27:17
Done.
|
| + if (footnote_container_->child_count() == 1 && |
| + details.child == footnote_container_->child_at(0)) { |
| + footnote_container_->SetVisible(false); |
| + footnote_container_ = nullptr; |
| + } |
| + } |
| +} |
| + |
| void BubbleFrameView::OnPaint(gfx::Canvas* canvas) { |
| OnPaintBackground(canvas); |
| // Border comes after children. |
| @@ -408,6 +419,16 @@ void BubbleFrameView::SetFootnoteView(View* view) { |
| AddChildView(footnote_container_); |
| } |
| +void BubbleFrameView::RemoveFootnoteView() { |
| + if (!footnote_container_) |
| + return; |
| + |
| + RemoveChildView(footnote_container_); |
| + footnote_container_->RemoveAllChildViews(true); |
| + delete footnote_container_; |
| + footnote_container_ = nullptr; |
| +} |
| + |
| gfx::Rect BubbleFrameView::GetUpdatedWindowBounds(const gfx::Rect& anchor_rect, |
| const gfx::Size& client_size, |
| bool adjust_if_offscreen) { |