Index: ui/views/window/dialog_client_view.cc |
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc |
index ba1698812e6e3c5b2bfad31c089d5eb218ff3496..4b75ef47bc77154fb83ea4b6fc7a4e49a8c7cd49 100644 |
--- a/ui/views/window/dialog_client_view.cc |
+++ b/ui/views/window/dialog_client_view.cc |
@@ -371,8 +371,8 @@ gfx::Size DialogClientView::GetPreferredSize() { |
} |
prefsize.Enlarge(0, button_height); |
- if (footnote_view_) { |
- gfx::Size footnote_size = footnote_view_->GetPreferredSize(); |
+ if (footnote_view_ && footnote_view_->visible()) { |
+ const gfx::Size& footnote_size = footnote_view_->GetPreferredSize(); |
prefsize.Enlarge(0, footnote_size.height()); |
prefsize.set_width(std::max(prefsize.width(), footnote_size.width())); |
} |
@@ -494,7 +494,8 @@ int DialogClientView::GetDialogButtonsAreaHeight() const { |
} |
int DialogClientView::GetFootnoteViewHeight() const { |
- return footnote_view_ ? footnote_view_->GetPreferredSize().height() : 0; |
+ return footnote_view_ && footnote_view_->visible() ? |
+ footnote_view_->GetPreferredSize().height() : 0; |
} |
void DialogClientView::LayoutDialogButtons() { |
@@ -502,7 +503,7 @@ void DialogClientView::LayoutDialogButtons() { |
gfx::Rect extra_bounds; |
int bottom_y = lb.bottom() - style_params_.button_vedge_margin; |
if (footnote_view_) |
sky
2013/02/14 22:47:10
I think you can remove the if.
Dan Beam
2013/02/15 01:48:31
Done.
|
- bottom_y -= footnote_view_->GetPreferredSize().height(); |
+ bottom_y -= GetFootnoteViewHeight(); |
int button_height = GetButtonsHeight(); |
if (cancel_button_) { |