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::MouseEvent::kMousePointerId; | |
171 | 170 |
172 // set position fields: | 171 // set position fields: |
173 result.SetPositionInWidget(static_cast<short>(LOWORD(lparam)), | 172 result.SetPositionInWidget(static_cast<short>(LOWORD(lparam)), |
174 static_cast<short>(HIWORD(lparam))); | 173 static_cast<short>(HIWORD(lparam))); |
175 | 174 |
176 POINT global_point = {result.PositionInWidget().x, | 175 POINT global_point = {result.PositionInWidget().x, |
177 result.PositionInWidget().y}; | 176 result.PositionInWidget().y}; |
178 ClientToScreen(hwnd, &global_point); | 177 ClientToScreen(hwnd, &global_point); |
179 | 178 |
180 // We need to convert the global point back to DIP before using it. | 179 // 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; | 358 result.wheel_ticks_x = wheel_delta; |
360 } else { | 359 } else { |
361 result.delta_y = scroll_delta; | 360 result.delta_y = scroll_delta; |
362 result.wheel_ticks_y = wheel_delta; | 361 result.wheel_ticks_y = wheel_delta; |
363 } | 362 } |
364 | 363 |
365 return result; | 364 return result; |
366 } | 365 } |
367 | 366 |
368 } // namespace ui | 367 } // namespace ui |
OLD | NEW |