Index: ui/views/widget/native_widget_win.cc |
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc |
index da6f1fca9741cbb8abfd027fb5d4c4f2ad7d8f88..6bd016ce356ac1616e45b42a7f7f0ce94656e87e 100644 |
--- a/ui/views/widget/native_widget_win.cc |
+++ b/ui/views/widget/native_widget_win.cc |
@@ -1385,17 +1385,24 @@ LRESULT NativeWidgetWin::OnGetObject(UINT uMsg, |
void NativeWidgetWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { |
gfx::Size min_window_size(delegate_->GetMinimumSize()); |
- // Add the native frame border size to the minimum size if the view reports |
- // its size as the client size. |
+ gfx::Size max_window_size(delegate_->GetMaximumSize()); |
+ // Add the native frame border size to the minimum and maximum size if the |
+ // view reports its size as the client size. |
if (WidgetSizeIsClientSize()) { |
CRect client_rect, window_rect; |
GetClientRect(&client_rect); |
GetWindowRect(&window_rect); |
window_rect -= client_rect; |
min_window_size.Enlarge(window_rect.Width(), window_rect.Height()); |
+ if (!max_window_size.IsEmpty()) |
+ max_window_size.Enlarge(window_rect.Width(), window_rect.Height()); |
} |
minmax_info->ptMinTrackSize.x = min_window_size.width(); |
minmax_info->ptMinTrackSize.y = min_window_size.height(); |
+ if (!max_window_size.IsEmpty()) { |
+ minmax_info->ptMaxTrackSize.x = max_window_size.width(); |
+ minmax_info->ptMaxTrackSize.y = max_window_size.height(); |
+ } |
SetMsgHandled(FALSE); |
} |