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

Unified Diff: ui/views/widget/native_widget_win.cc

Issue 9452008: Allow platform apps to specify a maximum size for the shell container. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing file Created 8 years, 10 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
« no previous file with comments | « ui/views/widget/native_widget_delegate.h ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « ui/views/widget/native_widget_delegate.h ('k') | ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698