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

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebasefinal Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698