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 | 10 |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
526 parent = ::GetWindow(hwnd(), GW_OWNER); | 526 parent = ::GetWindow(hwnd(), GW_OWNER); |
527 gfx::CenterAndSizeWindow(parent, hwnd(), size); | 527 gfx::CenterAndSizeWindow(parent, hwnd(), size); |
528 } | 528 } |
529 | 529 |
530 void HWNDMessageHandler::SetRegion(HRGN region) { | 530 void HWNDMessageHandler::SetRegion(HRGN region) { |
531 custom_window_region_.Set(region); | 531 custom_window_region_.Set(region); |
532 ResetWindowRegion(true, true); | 532 ResetWindowRegion(true, true); |
533 } | 533 } |
534 | 534 |
535 void HWNDMessageHandler::StackAbove(HWND other_hwnd) { | 535 void HWNDMessageHandler::StackAbove(HWND other_hwnd) { |
536 SetWindowPos(hwnd(), other_hwnd, 0, 0, 0, 0, | 536 // Find a window above |other_hwnd|. If it exists, place hwnd() behind it. |
sky
2015/06/05 15:27:41
This comment just describes what the code is doing
vasilii
2015/06/05 15:37:26
Done.
| |
537 // Otherwise, make hwnd() a top window. | |
538 HWND next_window = GetNextWindow(other_hwnd, GW_HWNDPREV); | |
sky
2015/06/05 15:27:41
DCHECK(other_hwnd)
vasilii
2015/06/05 15:37:26
Done.
| |
539 SetWindowPos(hwnd(), next_window ? next_window : HWND_TOP, 0, 0, 0, 0, | |
537 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); | 540 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); |
538 } | 541 } |
539 | 542 |
540 void HWNDMessageHandler::StackAtTop() { | 543 void HWNDMessageHandler::StackAtTop() { |
541 SetWindowPos(hwnd(), HWND_TOP, 0, 0, 0, 0, | 544 SetWindowPos(hwnd(), HWND_TOP, 0, 0, 0, 0, |
542 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); | 545 SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); |
543 } | 546 } |
544 | 547 |
545 void HWNDMessageHandler::Show() { | 548 void HWNDMessageHandler::Show() { |
546 if (IsWindow(hwnd())) { | 549 if (IsWindow(hwnd())) { |
(...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2742 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); | 2745 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); |
2743 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); | 2746 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); |
2744 } | 2747 } |
2745 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want | 2748 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want |
2746 // to notify our children too, since we can have MDI child windows who need to | 2749 // to notify our children too, since we can have MDI child windows who need to |
2747 // update their appearance. | 2750 // update their appearance. |
2748 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); | 2751 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); |
2749 } | 2752 } |
2750 | 2753 |
2751 } // namespace views | 2754 } // namespace views |
OLD | NEW |