Index: chrome/browser/ui/views/constrained_window_views.cc |
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc |
index 07ba0048700603bcc7a39b8c64cb9ee8e410a747..9f6df958513e7daed0f4df1a1d4624111a6d0c49 100644 |
--- a/chrome/browser/ui/views/constrained_window_views.cc |
+++ b/chrome/browser/ui/views/constrained_window_views.cc |
@@ -570,11 +570,16 @@ void ConstrainedWindowFrameView::InitClass() { |
void UpdateWebContentsModalDialogPosition( |
views::Widget* widget, |
web_modal::WebContentsModalDialogHost* dialog_host) { |
- gfx::Size size = widget->GetWindowBoundsInScreen().size(); |
- gfx::Point position = dialog_host->GetDialogPosition(size); |
+ gfx::Size size = widget->non_client_view()->GetPreferredSize(); |
views::Border* border = |
widget->non_client_view()->frame_view()->border(); |
+ gfx::Size max_size = dialog_host->GetMaximumDialogSize(); |
// Border may be null during widget initialization. |
+ if (border) |
+ max_size.set_height(max_size.height() + border->GetInsets().top()); |
+ size.SetToMin(max_size); |
+ |
+ gfx::Point position = dialog_host->GetDialogPosition(size); |
Mike Wittman
2013/08/22 17:46:10
Have you tested on other web contents modal dialog
Rune Fevang
2013/08/23 02:57:43
Yeah, works fine for all dialogs I tested on up to
|
if (border) { |
// Align the first row of pixels inside the border. This is the apparent |
// top of the dialog. |