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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 581953002: [Win] Update HWND style when SizeConstraintsChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hidpi
Patch Set: Fix on Linux. Created 6 years, 3 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
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 d726ea930d98d95feceb2da247503f41c5fabb27..e5b3bd50b514d8acbaf810e9a7d644ed536045e5 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() {
+ bool can_resize = delegate_->CanResize();
+ bool can_maximize = delegate_->CanMaximize();
+ LONG style = GetWindowLong(hwnd(), GWL_STYLE);
+ if (can_resize && can_maximize) {
+ style |= WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
+ } else {
+ style &= ~(WS_MINIMIZEBOX | WS_MAXIMIZEBOX);
+ }
+ if (can_resize) {
+ style |= WS_THICKFRAME;
+ } else {
+ style &= ~WS_THICKFRAME;
+ }
+ SetWindowLong(hwnd(), GWL_STYLE, style);
+}
+
////////////////////////////////////////////////////////////////////////////////
// HWNDMessageHandler, InputMethodDelegate implementation:
« ui/views/widget/widget_hwnd_utils.cc ('K') | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698