Chromium Code Reviews| Index: ui/views/win/hwnd_message_handler.cc |
| diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc |
| index f14b93d313c3b8716a2df2709771b2b0d8556b20..9ab9ee6db3bbc4329e36291d15dbfe0b381bd54c 100644 |
| --- a/ui/views/win/hwnd_message_handler.cc |
| +++ b/ui/views/win/hwnd_message_handler.cc |
| @@ -868,6 +868,23 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) { |
| PerformDwmTransition(); |
| } |
| +void HWNDMessageHandler::SizeConstraintsChanged() { |
| + LONG style = GetWindowLong(hwnd(), GWL_STYLE); |
| + if (delegate_->CanResize()) { |
| + style |= WS_THICKFRAME | WS_MAXIMIZEBOX; |
| + if (!delegate_->CanMaximize()) |
| + style &= ~WS_MAXIMIZEBOX; |
| + } else { |
| + style &= ~WS_THICKFRAME | WS_MAXIMIZEBOX; |
|
sky
2014/09/24 15:33:00
Can you put () around WS_THICKFRAME | WS_MAXIMIZEB
jackhou1
2014/09/24 23:30:35
Oh, good catch.
|
| + } |
| + if (delegate_->CanMinimize()) { |
| + style |= WS_MINIMIZEBOX; |
| + } else { |
| + style &= ~WS_MINIMIZEBOX; |
| + } |
| + SetWindowLong(hwnd(), GWL_STYLE, style); |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // HWNDMessageHandler, InputMethodDelegate implementation: |