| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/events/blink/web_input_event_builders_win.h" | 5 #include "ui/events/blink/web_input_event_builders_win.h" |
| 6 | 6 |
| 7 #include "ui/display/win/screen_win.h" | 7 #include "ui/display/win/screen_win.h" |
| 8 #include "ui/events/blink/blink_event_util.h" | 8 #include "ui/events/blink/blink_event_util.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 if (wparam & MK_LBUTTON) | 160 if (wparam & MK_LBUTTON) |
| 161 modifiers |= WebInputEvent::kLeftButtonDown; | 161 modifiers |= WebInputEvent::kLeftButtonDown; |
| 162 if (wparam & MK_MBUTTON) | 162 if (wparam & MK_MBUTTON) |
| 163 modifiers |= WebInputEvent::kMiddleButtonDown; | 163 modifiers |= WebInputEvent::kMiddleButtonDown; |
| 164 if (wparam & MK_RBUTTON) | 164 if (wparam & MK_RBUTTON) |
| 165 modifiers |= WebInputEvent::kRightButtonDown; | 165 modifiers |= WebInputEvent::kRightButtonDown; |
| 166 | 166 |
| 167 WebMouseEvent result(type, modifiers, time_stamp); | 167 WebMouseEvent result(type, modifiers, time_stamp); |
| 168 result.pointer_type = pointer_type; | 168 result.pointer_type = pointer_type; |
| 169 result.button = button; | 169 result.button = button; |
| 170 result.id = ui::PointerEvent::kMousePointerId; | 170 result.id = ui::MouseEvent::kMousePointerId; |
| 171 | 171 |
| 172 // set position fields: | 172 // set position fields: |
| 173 result.SetPositionInWidget(static_cast<short>(LOWORD(lparam)), | 173 result.SetPositionInWidget(static_cast<short>(LOWORD(lparam)), |
| 174 static_cast<short>(HIWORD(lparam))); | 174 static_cast<short>(HIWORD(lparam))); |
| 175 | 175 |
| 176 POINT global_point = {result.PositionInWidget().x, | 176 POINT global_point = {result.PositionInWidget().x, |
| 177 result.PositionInWidget().y}; | 177 result.PositionInWidget().y}; |
| 178 ClientToScreen(hwnd, &global_point); | 178 ClientToScreen(hwnd, &global_point); |
| 179 | 179 |
| 180 // We need to convert the global point back to DIP before using it. | 180 // We need to convert the global point back to DIP before using it. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 result.wheel_ticks_x = wheel_delta; | 359 result.wheel_ticks_x = wheel_delta; |
| 360 } else { | 360 } else { |
| 361 result.delta_y = scroll_delta; | 361 result.delta_y = scroll_delta; |
| 362 result.wheel_ticks_y = wheel_delta; | 362 result.wheel_ticks_y = wheel_delta; |
| 363 } | 363 } |
| 364 | 364 |
| 365 return result; | 365 return result; |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace ui | 368 } // namespace ui |
| OLD | NEW |