OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/views/hwnd_view_container.h" | 5 #include "chrome/views/hwnd_view_container.h" |
6 | 6 |
7 #include "base/gfx/native_theme.h" | 7 #include "base/gfx/native_theme.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/win_util.h" | 9 #include "base/win_util.h" |
10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 void HWNDViewContainer::ProcessMouseMoved(const CPoint &point, UINT flags, | 738 void HWNDViewContainer::ProcessMouseMoved(const CPoint &point, UINT flags, |
739 bool is_nonclient) { | 739 bool is_nonclient) { |
740 // Windows only fires WM_MOUSELEAVE events if the application begins | 740 // Windows only fires WM_MOUSELEAVE events if the application begins |
741 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. | 741 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. |
742 // We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE. | 742 // We need to call |TrackMouseEvents| to listen for WM_MOUSELEAVE. |
743 if (!has_capture_) | 743 if (!has_capture_) |
744 TrackMouseEvents(is_nonclient ? TME_NONCLIENT | TME_LEAVE : TME_LEAVE); | 744 TrackMouseEvents(is_nonclient ? TME_NONCLIENT | TME_LEAVE : TME_LEAVE); |
745 if (has_capture_ && is_mouse_down_) { | 745 if (has_capture_ && is_mouse_down_) { |
746 ProcessMouseDragged(point, flags); | 746 ProcessMouseDragged(point, flags); |
747 } else { | 747 } else { |
748 CPoint screen_loc = point; | 748 gfx::Point screen_loc(point); |
749 View::ConvertPointToScreen(root_view_.get(), &screen_loc); | 749 View::ConvertPointToScreen(root_view_.get(), &screen_loc); |
750 if (last_mouse_event_was_move_ && last_mouse_move_x_ == screen_loc.x && | 750 if (last_mouse_event_was_move_ && last_mouse_move_x_ == screen_loc.x() && |
751 last_mouse_move_y_ == screen_loc.y) { | 751 last_mouse_move_y_ == screen_loc.y()) { |
752 // Don't generate a mouse event for the same location as the last. | 752 // Don't generate a mouse event for the same location as the last. |
753 return; | 753 return; |
754 } | 754 } |
755 last_mouse_move_x_ = screen_loc.x; | 755 last_mouse_move_x_ = screen_loc.x(); |
756 last_mouse_move_y_ = screen_loc.y; | 756 last_mouse_move_y_ = screen_loc.y(); |
757 last_mouse_event_was_move_ = true; | 757 last_mouse_event_was_move_ = true; |
758 MouseEvent mouse_move(Event::ET_MOUSE_MOVED, | 758 MouseEvent mouse_move(Event::ET_MOUSE_MOVED, |
759 point.x, | 759 point.x, |
760 point.y, | 760 point.y, |
761 Event::ConvertWindowsFlags(flags)); | 761 Event::ConvertWindowsFlags(flags)); |
762 root_view_->OnMouseMoved(mouse_move); | 762 root_view_->OnMouseMoved(mouse_move); |
763 } | 763 } |
764 } | 764 } |
765 | 765 |
766 void HWNDViewContainer::ProcessMouseExited() { | 766 void HWNDViewContainer::ProcessMouseExited() { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 result = DefWindowProc(window, message, w_param, l_param); | 919 result = DefWindowProc(window, message, w_param, l_param); |
920 if (message == WM_NCDESTROY) { | 920 if (message == WM_NCDESTROY) { |
921 vc->hwnd_ = NULL; | 921 vc->hwnd_ = NULL; |
922 vc->OnFinalMessage(window); | 922 vc->OnFinalMessage(window); |
923 } | 923 } |
924 return result; | 924 return result; |
925 } | 925 } |
926 | 926 |
927 } // namespace ChromeViews | 927 } // namespace ChromeViews |
928 | 928 |
OLD | NEW |