| 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 #include <tchar.h> | 10 #include <tchar.h> |
| (...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1742 break; | 1742 break; |
| 1743 case WM_POINTERENTER: | 1743 case WM_POINTERENTER: |
| 1744 event_type = ui::ET_MOUSE_ENTERED; | 1744 event_type = ui::ET_MOUSE_ENTERED; |
| 1745 break; | 1745 break; |
| 1746 case WM_POINTERLEAVE: | 1746 case WM_POINTERLEAVE: |
| 1747 event_type = ui::ET_MOUSE_EXITED; | 1747 event_type = ui::ET_MOUSE_EXITED; |
| 1748 break; | 1748 break; |
| 1749 default: | 1749 default: |
| 1750 NOTREACHED(); | 1750 NOTREACHED(); |
| 1751 } | 1751 } |
| 1752 ui::MouseEvent event(event_type, point, point, base::TimeTicks::Now(), flag, | |
| 1753 flag); | |
| 1754 ui::PointerDetails pointer_details( | 1752 ui::PointerDetails pointer_details( |
| 1755 input_type, pointer_id, /* radius_x */ 0.0f, /* radius_y */ 0.0f, | 1753 input_type, pointer_id, /* radius_x */ 0.0f, /* radius_y */ 0.0f, |
| 1756 pressure, tilt_x, tilt_y, /* tangential_pressure */ 0.0f, rotation); | 1754 pressure, tilt_x, tilt_y, /* tangential_pressure */ 0.0f, rotation); |
| 1757 event.set_pointer_details(pointer_details); | 1755 ui::MouseEvent event(event_type, point, point, base::TimeTicks::Now(), flag, |
| 1756 flag, pointer_details); |
| 1758 event.SetClickCount(click_count); | 1757 event.SetClickCount(click_count); |
| 1759 | 1758 |
| 1760 // There are cases where the code handling the message destroys the | 1759 // There are cases where the code handling the message destroys the |
| 1761 // window, so use the weak ptr to check if destruction occured or not. | 1760 // window, so use the weak ptr to check if destruction occured or not. |
| 1762 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); | 1761 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); |
| 1763 bool handled = delegate_->HandleMouseEvent(event); | 1762 bool handled = delegate_->HandleMouseEvent(event); |
| 1764 | 1763 |
| 1765 if (ref) | 1764 if (ref) |
| 1766 SetMsgHandled(handled); | 1765 SetMsgHandled(handled); |
| 1767 return 0; | 1766 return 0; |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2908 MONITORINFO monitor_info = {sizeof(monitor_info)}; | 2907 MONITORINFO monitor_info = {sizeof(monitor_info)}; |
| 2909 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 2908 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
| 2910 &monitor_info); | 2909 &monitor_info); |
| 2911 gfx::Rect shrunk_rect(monitor_info.rcMonitor); | 2910 gfx::Rect shrunk_rect(monitor_info.rcMonitor); |
| 2912 shrunk_rect.set_height(shrunk_rect.height() - 1); | 2911 shrunk_rect.set_height(shrunk_rect.height() - 1); |
| 2913 background_fullscreen_hack_ = true; | 2912 background_fullscreen_hack_ = true; |
| 2914 SetBoundsInternal(shrunk_rect, false); | 2913 SetBoundsInternal(shrunk_rect, false); |
| 2915 } | 2914 } |
| 2916 | 2915 |
| 2917 } // namespace views | 2916 } // namespace views |
| OLD | NEW |