diff options
Diffstat (limited to 'chrome/views')
-rw-r--r-- | chrome/views/widget/widget_win.h | 4 | ||||
-rw-r--r-- | chrome/views/window/custom_frame_view.cc | 1 | ||||
-rw-r--r-- | chrome/views/window/non_client_view.cc | 7 | ||||
-rw-r--r-- | chrome/views/window/non_client_view.h | 1 | ||||
-rw-r--r-- | chrome/views/window/window_win.cc | 7 | ||||
-rw-r--r-- | chrome/views/window/window_win.h | 1 |
6 files changed, 20 insertions, 1 deletions
diff --git a/chrome/views/widget/widget_win.h b/chrome/views/widget/widget_win.h index ede4252..110a0b4 100644 --- a/chrome/views/widget/widget_win.h +++ b/chrome/views/widget/widget_win.h @@ -178,6 +178,7 @@ class WidgetWin : public Widget, MSG_WM_ENDSESSION(OnEndSession) MSG_WM_ENTERSIZEMOVE(OnEnterSizeMove) MSG_WM_EXITMENULOOP(OnExitMenuLoop) + MSG_WM_GETMINMAXINFO(OnGetMinMaxInfo) MSG_WM_HSCROLL(OnHScroll) MSG_WM_INITMENU(OnInitMenu) MSG_WM_INITMENUPOPUP(OnInitMenuPopup) @@ -376,6 +377,9 @@ class WidgetWin : public Widget, } virtual LRESULT OnEraseBkgnd(HDC dc); virtual LRESULT OnGetObject(UINT uMsg, WPARAM w_param, LPARAM l_param); + virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info) { + SetMsgHandled(FALSE); + } virtual void OnHScroll(int scroll_type, short position, HWND scrollbar) { SetMsgHandled(FALSE); } diff --git a/chrome/views/window/custom_frame_view.cc b/chrome/views/window/custom_frame_view.cc index b1ef417..9c07817 100644 --- a/chrome/views/window/custom_frame_view.cc +++ b/chrome/views/window/custom_frame_view.cc @@ -370,7 +370,6 @@ void CustomFrameView::Layout() { gfx::Size CustomFrameView::GetPreferredSize() { gfx::Size pref = frame_->GetClientView()->GetPreferredSize(); - DCHECK(pref.width() > 0 && pref.height() > 0); gfx::Rect bounds(0, 0, pref.width(), pref.height()); return frame_->GetNonClientView()->GetWindowBoundsForClientBounds( bounds).size(); diff --git a/chrome/views/window/non_client_view.cc b/chrome/views/window/non_client_view.cc index bc69587..29daf06 100644 --- a/chrome/views/window/non_client_view.cc +++ b/chrome/views/window/non_client_view.cc @@ -131,10 +131,17 @@ void NonClientView::LayoutFrameView() { // NonClientView, View overrides: gfx::Size NonClientView::GetPreferredSize() { + // TODO(pkasting): This should probably be made to look similar to + // GetMinimumSize() below. This will require implementing GetPreferredSize() + // better in the various frame views. gfx::Rect client_bounds(gfx::Point(), client_view_->GetPreferredSize()); return GetWindowBoundsForClientBounds(client_bounds).size(); } +gfx::Size NonClientView::GetMinimumSize() { + return frame_view_->GetMinimumSize(); +} + void NonClientView::Layout() { LayoutFrameView(); diff --git a/chrome/views/window/non_client_view.h b/chrome/views/window/non_client_view.h index 0481cfd..e82ec77 100644 --- a/chrome/views/window/non_client_view.h +++ b/chrome/views/window/non_client_view.h @@ -192,6 +192,7 @@ class NonClientView : public View { // NonClientView, View overrides: virtual gfx::Size GetPreferredSize(); + virtual gfx::Size GetMinimumSize(); virtual void Layout(); protected: diff --git a/chrome/views/window/window_win.cc b/chrome/views/window/window_win.cc index 3d2c74f..8c03219 100644 --- a/chrome/views/window/window_win.cc +++ b/chrome/views/window/window_win.cc @@ -640,6 +640,13 @@ void WindowWin::OnFinalMessage(HWND window) { WidgetWin::OnFinalMessage(window); } +void WindowWin::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { + gfx::Size min_window_size(GetNonClientView()->GetMinimumSize()); + minmax_info->ptMinTrackSize.x = min_window_size.width(); + minmax_info->ptMinTrackSize.y = min_window_size.height(); + WidgetWin::OnGetMinMaxInfo(minmax_info); +} + namespace { static void EnableMenuItem(HMENU menu, UINT command, bool enabled) { UINT flags = MF_BYCOMMAND | (enabled ? MF_ENABLED : MF_DISABLED | MF_GRAYED); diff --git a/chrome/views/window/window_win.h b/chrome/views/window/window_win.h index cd7bd50..222ac52 100644 --- a/chrome/views/window/window_win.h +++ b/chrome/views/window/window_win.h @@ -129,6 +129,7 @@ class WindowWin : public WidgetWin, virtual LRESULT OnDwmCompositionChanged(UINT msg, WPARAM w_param, LPARAM l_param); virtual void OnFinalMessage(HWND window); + virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info); virtual void OnInitMenu(HMENU menu); virtual void OnMouseLeave(); virtual LRESULT OnNCActivate(BOOL active); |