summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 20:06:11 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 20:06:11 +0000
commitea127857621dd27718f34791e1ba103881a37257 (patch)
treec662558865b4f02ad945587e892fc91487c10b4b /views
parentc0d9ebb8cd577f3040e0bf0a51b01f68d332f4e4 (diff)
downloadchromium_src-ea127857621dd27718f34791e1ba103881a37257.zip
chromium_src-ea127857621dd27718f34791e1ba103881a37257.tar.gz
chromium_src-ea127857621dd27718f34791e1ba103881a37257.tar.bz2
Fixes bug in clear browsing data dialog where throbber would overlap
flash link. BUG=35009 TEST=bring up clear browsing data, click clear browsing data and make sure throbber doesn't overlap flash link. Review URL: http://codereview.chromium.org/577054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/window/dialog_client_view.cc10
-rw-r--r--views/window/dialog_client_view.h4
-rw-r--r--views/window/dialog_delegate.h6
3 files changed, 19 insertions, 1 deletions
diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc
index 7ea51f1..3eac93c 100644
--- a/views/window/dialog_client_view.cc
+++ b/views/window/dialog_client_view.cc
@@ -110,6 +110,7 @@ DialogClientView::DialogClientView(Window* owner, View* contents_view)
cancel_button_(NULL),
default_button_(NULL),
extra_view_(NULL),
+ size_extra_view_height_to_buttons_(false),
accepted_(false),
listening_to_focus_(false),
saved_focus_manager_(NULL),
@@ -462,6 +463,7 @@ void DialogClientView::LayoutDialogButtons() {
gfx::Rect lb = GetLocalBounds(false);
gfx::Rect extra_bounds;
int bottom_y = lb.bottom() - kButtonVEdgeMargin;
+ int button_height = 0;
if (bottom_view_) {
gfx::Size bottom_pref = bottom_view_->GetPreferredSize();
bottom_y -= bottom_pref.height() + kButtonVEdgeMargin + kButtonVEdgeMargin;
@@ -476,6 +478,7 @@ void DialogClientView::LayoutDialogButtons() {
// The extra view bounds are dependent on this button.
extra_bounds.set_width(std::max(0, cancel_button_->x()));
extra_bounds.set_y(cancel_button_->y());
+ button_height = std::max(button_height, ps.height());
}
if (ok_button_) {
gfx::Size ps = ok_button_->GetPreferredSize();
@@ -491,11 +494,14 @@ void DialogClientView::LayoutDialogButtons() {
// The extra view bounds are dependent on this button.
extra_bounds.set_width(std::max(0, ok_button_->x()));
extra_bounds.set_y(ok_button_->y());
+ button_height = std::max(button_height, ps.height());
}
if (extra_view_) {
gfx::Size ps = extra_view_->GetPreferredSize();
extra_bounds.set_x(lb.x() + kButtonHEdgeMargin);
- extra_bounds.set_height(ps.height());
+ int height = size_extra_view_height_to_buttons_ ?
+ std::max(ps.height(), button_height) : ps.height();
+ extra_bounds.set_height(height);
extra_view_->SetBounds(extra_bounds);
}
}
@@ -513,6 +519,8 @@ void DialogClientView::CreateExtraView() {
extra_view_ = extra_view;
extra_view_->SetGroup(kButtonGroup);
AddChildView(extra_view_);
+ size_extra_view_height_to_buttons_ =
+ GetDialogDelegate()->GetSizeExtraViewHeightToButtons();
}
}
diff --git a/views/window/dialog_client_view.h b/views/window/dialog_client_view.h
index e23e346..193ce1f 100644
--- a/views/window/dialog_client_view.h
+++ b/views/window/dialog_client_view.h
@@ -126,6 +126,10 @@ class DialogClientView : public ClientView,
// The button-level extra view, NULL unless the dialog delegate supplies one.
View* extra_view_;
+ // See description of DialogDelegate::GetSizeExtraViewHeightToButtons for
+ // details on this.
+ bool size_extra_view_height_to_buttons_;
+
// The layout rect of the size box, when visible.
gfx::Rect size_box_bounds_;
diff --git a/views/window/dialog_delegate.h b/views/window/dialog_delegate.h
index 19c2a89..ebfde24 100644
--- a/views/window/dialog_delegate.h
+++ b/views/window/dialog_delegate.h
@@ -59,6 +59,12 @@ class DialogDelegate : public WindowDelegate {
// up to the buttons.
virtual View* GetExtraView() { return NULL; }
+ // Returns whether the height of the extra view should be at least as tall as
+ // the buttons. The default (false) is to give the extra view it's preferred
+ // height. By returning true the height becomes
+ // max(extra_view preferred height, buttons preferred height).
+ virtual bool GetSizeExtraViewHeightToButtons() { return false; }
+
// Returns the default dialog button. This should not be a mask as only
// one button should ever be the default button. Return
// MessageBoxFlags::DIALOGBUTTON_NONE if there is no default. Default