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

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: Address comments 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
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..36003484d16703d33691bc9b308f4757446edc9f 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);
+ }
+ if (delegate_->CanMinimize()) {
+ style |= WS_MINIMIZEBOX;
+ } else {
+ style &= ~WS_MINIMIZEBOX;
+ }
+ SetWindowLong(hwnd(), GWL_STYLE, style);
+}
+
////////////////////////////////////////////////////////////////////////////////
// HWNDMessageHandler, InputMethodDelegate implementation:
« no previous file with comments | « 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