| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/win/hwnd_message_handler.h" | 5 #include "ui/views/win/hwnd_message_handler.h" |
| 6 | 6 |
| 7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
| 8 #include <oleacc.h> | 8 #include <oleacc.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <wtsapi32.h> | 10 #include <wtsapi32.h> |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 fullscreen_handler()->SetFullscreen(fullscreen); | 864 fullscreen_handler()->SetFullscreen(fullscreen); |
| 865 // If we are out of fullscreen and there was a pending DWM transition for the | 865 // If we are out of fullscreen and there was a pending DWM transition for the |
| 866 // window, then go ahead and do it now. | 866 // window, then go ahead and do it now. |
| 867 if (!fullscreen && dwm_transition_desired_) | 867 if (!fullscreen && dwm_transition_desired_) |
| 868 PerformDwmTransition(); | 868 PerformDwmTransition(); |
| 869 } | 869 } |
| 870 | 870 |
| 871 void HWNDMessageHandler::SizeConstraintsChanged() { | 871 void HWNDMessageHandler::SizeConstraintsChanged() { |
| 872 LONG style = GetWindowLong(hwnd(), GWL_STYLE); | 872 LONG style = GetWindowLong(hwnd(), GWL_STYLE); |
| 873 // Ignore if this is not a standard window. | 873 // Ignore if this is not a standard window. |
| 874 if (!(style & WS_OVERLAPPED)) | 874 // WS_OVERLAPPED is just the *absence* of WS_POPUP and WS_CHILD. |
| 875 if ((style & (WS_POPUP | WS_CHILD)) == WS_OVERLAPPED) |
| 875 return; | 876 return; |
| 876 | 877 |
| 877 if (delegate_->CanResize()) { | 878 if (delegate_->CanResize()) { |
| 878 style |= WS_THICKFRAME | WS_MAXIMIZEBOX; | 879 style |= WS_THICKFRAME | WS_MAXIMIZEBOX; |
| 879 if (!delegate_->CanMaximize()) | 880 if (!delegate_->CanMaximize()) |
| 880 style &= ~WS_MAXIMIZEBOX; | 881 style &= ~WS_MAXIMIZEBOX; |
| 881 } else { | 882 } else { |
| 882 style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX); | 883 style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX); |
| 883 } | 884 } |
| 884 if (delegate_->CanMinimize()) { | 885 if (delegate_->CanMinimize()) { |
| (...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2493 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); | 2494 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); |
| 2494 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); | 2495 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); |
| 2495 } | 2496 } |
| 2496 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want | 2497 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want |
| 2497 // to notify our children too, since we can have MDI child windows who need to | 2498 // to notify our children too, since we can have MDI child windows who need to |
| 2498 // update their appearance. | 2499 // update their appearance. |
| 2499 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); | 2500 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); |
| 2500 } | 2501 } |
| 2501 | 2502 |
| 2502 } // namespace views | 2503 } // namespace views |
| OLD | NEW |