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 <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 } | 661 } |
662 | 662 |
663 bool HWNDMessageHandler::IsMinimized() const { | 663 bool HWNDMessageHandler::IsMinimized() const { |
664 return !!::IsIconic(hwnd()); | 664 return !!::IsIconic(hwnd()); |
665 } | 665 } |
666 | 666 |
667 bool HWNDMessageHandler::IsMaximized() const { | 667 bool HWNDMessageHandler::IsMaximized() const { |
668 return !!::IsZoomed(hwnd()); | 668 return !!::IsZoomed(hwnd()); |
669 } | 669 } |
670 | 670 |
671 bool HWNDMessageHandler::RunMoveLoop(const gfx::Point& drag_offset) { | 671 bool HWNDMessageHandler::RunMoveLoop(const gfx::Vector2d& drag_offset) { |
672 ReleaseCapture(); | 672 ReleaseCapture(); |
673 MoveLoopMouseWatcher watcher(this); | 673 MoveLoopMouseWatcher watcher(this); |
674 SendMessage(hwnd(), WM_SYSCOMMAND, SC_MOVE | 0x0002, GetMessagePos()); | 674 SendMessage(hwnd(), WM_SYSCOMMAND, SC_MOVE | 0x0002, GetMessagePos()); |
675 // Windows doesn't appear to offer a way to determine whether the user | 675 // Windows doesn't appear to offer a way to determine whether the user |
676 // canceled the move or not. We assume if the user released the mouse it was | 676 // canceled the move or not. We assume if the user released the mouse it was |
677 // successful. | 677 // successful. |
678 return watcher.got_mouse_up(); | 678 return watcher.got_mouse_up(); |
679 } | 679 } |
680 | 680 |
681 void HWNDMessageHandler::EndMoveLoop() { | 681 void HWNDMessageHandler::EndMoveLoop() { |
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2074 DwmExtendFrameIntoClientArea(hwnd(), &m); | 2074 DwmExtendFrameIntoClientArea(hwnd(), &m); |
2075 } | 2075 } |
2076 if (window_pos->flags & SWP_SHOWWINDOW) | 2076 if (window_pos->flags & SWP_SHOWWINDOW) |
2077 delegate_->HandleVisibilityChanged(true); | 2077 delegate_->HandleVisibilityChanged(true); |
2078 else if (window_pos->flags & SWP_HIDEWINDOW) | 2078 else if (window_pos->flags & SWP_HIDEWINDOW) |
2079 delegate_->HandleVisibilityChanged(false); | 2079 delegate_->HandleVisibilityChanged(false); |
2080 SetMsgHandled(FALSE); | 2080 SetMsgHandled(FALSE); |
2081 } | 2081 } |
2082 | 2082 |
2083 } // namespace views | 2083 } // namespace views |
OLD | NEW |