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