Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 2955963002: Update Chrome Upstream flow to reflect new UI mocks (Closed)
Patch Set: Code review changes Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« components/autofill_strings.grdp ('K') | « components/autofill_strings.grdp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ef2e9dd1a1eb1d3c1adf9f1fd58bd407bfd931a2 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,7 +542,10 @@ gfx::Size BubbleFrameView::GetSizeForClientSize(
size.Enlarge(client_insets.width(), client_insets.height());
size.SetToMax(gfx::Size(title_bar_width, 0));
- if (footnote_container_)
+ if (footnote_container_ && footnote_container_->child_count() >= 1)
Mathieu 2017/06/27 21:12:06 {}
Jared Saul 2017/06/27 21:45:55 Factored out the footnote_container_ check and add
+ footnote_container_->SetVisible(
+ footnote_container_->child_at(0)->visible());
+ if (footnote_container_ && footnote_container_->visible())
size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width()));
DialogDelegate* dialog_delegate =
« components/autofill_strings.grdp ('K') | « components/autofill_strings.grdp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698