| 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 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 break; | 1716 break; |
| 1717 case WM_POINTERENTER: | 1717 case WM_POINTERENTER: |
| 1718 event_type = ui::ET_MOUSE_ENTERED; | 1718 event_type = ui::ET_MOUSE_ENTERED; |
| 1719 break; | 1719 break; |
| 1720 case WM_POINTERLEAVE: | 1720 case WM_POINTERLEAVE: |
| 1721 event_type = ui::ET_MOUSE_EXITED; | 1721 event_type = ui::ET_MOUSE_EXITED; |
| 1722 break; | 1722 break; |
| 1723 default: | 1723 default: |
| 1724 NOTREACHED(); | 1724 NOTREACHED(); |
| 1725 } | 1725 } |
| 1726 ui::MouseEvent event(event_type, point, point, base::TimeTicks::Now(), flag, | |
| 1727 flag); | |
| 1728 ui::PointerDetails pointer_details( | 1726 ui::PointerDetails pointer_details( |
| 1729 ui::EventPointerType::POINTER_TYPE_PEN, pointer_id, | 1727 ui::EventPointerType::POINTER_TYPE_PEN, pointer_id, |
| 1730 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure, tilt_x, tilt_y, | 1728 /* radius_x */ 0.0f, /* radius_y */ 0.0f, pressure, tilt_x, tilt_y, |
| 1731 /* tangential_pressure */ 0.0f, rotation); | 1729 /* tangential_pressure */ 0.0f, rotation); |
| 1732 event.set_pointer_details(pointer_details); | 1730 ui::MouseEvent event(event_type, point, point, base::TimeTicks::Now(), flag, |
| 1731 flag, pointer_details); |
| 1733 event.SetClickCount(click_count); | 1732 event.SetClickCount(click_count); |
| 1734 | 1733 |
| 1735 // There are cases where the code handling the message destroys the | 1734 // There are cases where the code handling the message destroys the |
| 1736 // window, so use the weak ptr to check if destruction occured or not. | 1735 // window, so use the weak ptr to check if destruction occured or not. |
| 1737 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); | 1736 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); |
| 1738 bool handled = delegate_->HandleMouseEvent(event); | 1737 bool handled = delegate_->HandleMouseEvent(event); |
| 1739 | 1738 |
| 1740 if (ref) | 1739 if (ref) |
| 1741 SetMsgHandled(handled); | 1740 SetMsgHandled(handled); |
| 1742 return 0; | 1741 return 0; |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2883 MONITORINFO monitor_info = {sizeof(monitor_info)}; | 2882 MONITORINFO monitor_info = {sizeof(monitor_info)}; |
| 2884 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 2883 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
| 2885 &monitor_info); | 2884 &monitor_info); |
| 2886 gfx::Rect shrunk_rect(monitor_info.rcMonitor); | 2885 gfx::Rect shrunk_rect(monitor_info.rcMonitor); |
| 2887 shrunk_rect.set_height(shrunk_rect.height() - 1); | 2886 shrunk_rect.set_height(shrunk_rect.height() - 1); |
| 2888 background_fullscreen_hack_ = true; | 2887 background_fullscreen_hack_ = true; |
| 2889 SetBoundsInternal(shrunk_rect, false); | 2888 SetBoundsInternal(shrunk_rect, false); |
| 2890 } | 2889 } |
| 2891 | 2890 |
| 2892 } // namespace views | 2891 } // namespace views |
| OLD | NEW |