| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/menu/menu_controller.h" | 5 #include "views/controls/menu/menu_controller.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 event_type = in_client_area ? WM_LBUTTONDOWN : WM_NCLBUTTONDOWN; | 1819 event_type = in_client_area ? WM_LBUTTONDOWN : WM_NCLBUTTONDOWN; |
| 1820 else if (event.IsMiddleMouseButton()) | 1820 else if (event.IsMiddleMouseButton()) |
| 1821 event_type = in_client_area ? WM_MBUTTONDOWN : WM_NCMBUTTONDOWN; | 1821 event_type = in_client_area ? WM_MBUTTONDOWN : WM_NCMBUTTONDOWN; |
| 1822 else if (event.IsRightMouseButton()) | 1822 else if (event.IsRightMouseButton()) |
| 1823 event_type = in_client_area ? WM_RBUTTONDOWN : WM_NCRBUTTONDOWN; | 1823 event_type = in_client_area ? WM_RBUTTONDOWN : WM_NCRBUTTONDOWN; |
| 1824 else | 1824 else |
| 1825 event_type = 0; // Unknown mouse press. | 1825 event_type = 0; // Unknown mouse press. |
| 1826 | 1826 |
| 1827 if (event_type) { | 1827 if (event_type) { |
| 1828 if (in_client_area) { | 1828 if (in_client_area) { |
| 1829 PostMessage(window, event_type, event.GetWindowsFlags(), | 1829 PostMessage(window, event_type, event.native_event().wParam, |
| 1830 MAKELPARAM(window_x, window_y)); | 1830 MAKELPARAM(window_x, window_y)); |
| 1831 } else { | 1831 } else { |
| 1832 PostMessage(window, event_type, nc_hit_result, | 1832 PostMessage(window, event_type, nc_hit_result, |
| 1833 MAKELPARAM(screen_loc.x(), screen_loc.y())); | 1833 MAKELPARAM(screen_loc.x(), screen_loc.y())); |
| 1834 } | 1834 } |
| 1835 } | 1835 } |
| 1836 } | 1836 } |
| 1837 } | 1837 } |
| 1838 #endif // !defined(USE_AURA) | 1838 #endif // !defined(USE_AURA) |
| 1839 #endif // defined(OS_WIN) | 1839 #endif // defined(OS_WIN) |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1936 return; | 1936 return; |
| 1937 | 1937 |
| 1938 // Reset the active_mouse_view_ before sending mouse capture lost. That way if | 1938 // Reset the active_mouse_view_ before sending mouse capture lost. That way if |
| 1939 // it calls back to us, we aren't in a weird state. | 1939 // it calls back to us, we aren't in a weird state. |
| 1940 View* active_view = active_mouse_view_; | 1940 View* active_view = active_mouse_view_; |
| 1941 active_mouse_view_ = NULL; | 1941 active_mouse_view_ = NULL; |
| 1942 active_view->OnMouseCaptureLost(); | 1942 active_view->OnMouseCaptureLost(); |
| 1943 } | 1943 } |
| 1944 | 1944 |
| 1945 } // namespace views | 1945 } // namespace views |
| OLD | NEW |