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/widget/native_widget_win.h" | 5 #include "ui/views/widget/native_widget_win.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1621 (w_param == HTCAPTION || w_param == HTSYSMENU)) { | 1621 (w_param == HTCAPTION || w_param == HTSYSMENU)) { |
1622 is_right_mouse_pressed_on_caption_ = true; | 1622 is_right_mouse_pressed_on_caption_ = true; |
1623 // We SetCapture() to ensure we only show the menu when the button | 1623 // We SetCapture() to ensure we only show the menu when the button |
1624 // down and up are both on the caption. Note: this causes the button up to | 1624 // down and up are both on the caption. Note: this causes the button up to |
1625 // be WM_RBUTTONUP instead of WM_NCRBUTTONUP. | 1625 // be WM_RBUTTONUP instead of WM_NCRBUTTONUP. |
1626 SetCapture(); | 1626 SetCapture(); |
1627 } | 1627 } |
1628 | 1628 |
1629 MSG msg = { hwnd(), message, w_param, l_param, 0, | 1629 MSG msg = { hwnd(), message, w_param, l_param, 0, |
1630 { GET_X_LPARAM(l_param), GET_Y_LPARAM(l_param) } }; | 1630 { GET_X_LPARAM(l_param), GET_Y_LPARAM(l_param) } }; |
1631 MouseEvent event(msg); | 1631 ui::MouseEvent event(msg); |
1632 if (!touch_ids_.empty() || ui::IsMouseEventFromTouch(message)) | 1632 if (!touch_ids_.empty() || ui::IsMouseEventFromTouch(message)) |
1633 event.set_flags(event.flags() | ui::EF_FROM_TOUCH); | 1633 event.set_flags(event.flags() | ui::EF_FROM_TOUCH); |
1634 | 1634 |
1635 if (!(event.flags() & ui::EF_IS_NON_CLIENT)) | 1635 if (!(event.flags() & ui::EF_IS_NON_CLIENT)) |
1636 if (tooltip_manager_.get()) | 1636 if (tooltip_manager_.get()) |
1637 tooltip_manager_->OnMouse(message, w_param, l_param); | 1637 tooltip_manager_->OnMouse(message, w_param, l_param); |
1638 | 1638 |
1639 if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture()) { | 1639 if (event.type() == ui::ET_MOUSE_MOVED && !HasCapture()) { |
1640 // Windows only fires WM_MOUSELEAVE events if the application begins | 1640 // Windows only fires WM_MOUSELEAVE events if the application begins |
1641 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. | 1641 // "tracking" mouse events for a given HWND during WM_MOUSEMOVE events. |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2770 // static | 2770 // static |
2771 bool NativeWidgetPrivate::IsTouchDown() { | 2771 bool NativeWidgetPrivate::IsTouchDown() { |
2772 // This currently isn't necessary because we're not generating touch events on | 2772 // This currently isn't necessary because we're not generating touch events on |
2773 // windows. When we do, this will need to be updated. | 2773 // windows. When we do, this will need to be updated. |
2774 return false; | 2774 return false; |
2775 } | 2775 } |
2776 | 2776 |
2777 } // namespace internal | 2777 } // namespace internal |
2778 | 2778 |
2779 } // namespace views | 2779 } // namespace views |
OLD | NEW |