Chromium Code Reviews| 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::LeftButtonDown; | 161 modifiers |= WebInputEvent::LeftButtonDown; |
| 162 if (wparam & MK_MBUTTON) | 162 if (wparam & MK_MBUTTON) |
| 163 modifiers |= WebInputEvent::MiddleButtonDown; | 163 modifiers |= WebInputEvent::MiddleButtonDown; |
| 164 if (wparam & MK_RBUTTON) | 164 if (wparam & MK_RBUTTON) |
| 165 modifiers |= WebInputEvent::RightButtonDown; | 165 modifiers |= WebInputEvent::RightButtonDown; |
| 166 | 166 |
| 167 WebMouseEvent result(type, modifiers, time_stamp); | 167 WebMouseEvent result(type, modifiers, time_stamp); |
| 168 result.pointerType = pointer_type; | 168 result.pointerType = pointer_type; |
| 169 result.button = button; | 169 result.button = button; |
| 170 result.id = ui::PointerEvent::kMousePointerId; | |
|
mustaq
2017/02/27 16:02:26
Are we sure that stylus events are not going throu
| |
| 170 | 171 |
| 171 // set position fields: | 172 // set position fields: |
| 172 | |
| 173 result.x = static_cast<short>(LOWORD(lparam)); | 173 result.x = static_cast<short>(LOWORD(lparam)); |
| 174 result.y = static_cast<short>(HIWORD(lparam)); | 174 result.y = static_cast<short>(HIWORD(lparam)); |
| 175 result.windowX = result.x; | 175 result.windowX = result.x; |
| 176 result.windowY = result.y; | 176 result.windowY = result.y; |
| 177 | 177 |
| 178 POINT global_point = {result.x, result.y}; | 178 POINT global_point = {result.x, result.y}; |
| 179 ClientToScreen(hwnd, &global_point); | 179 ClientToScreen(hwnd, &global_point); |
| 180 | 180 |
| 181 // We need to convert the global point back to DIP before using it. | 181 // We need to convert the global point back to DIP before using it. |
| 182 gfx::Point dip_global_point = display::win::ScreenWin::ScreenToDIPPoint( | 182 gfx::Point dip_global_point = display::win::ScreenWin::ScreenToDIPPoint( |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 365 result.wheelTicksX = wheel_delta; | 365 result.wheelTicksX = wheel_delta; |
| 366 } else { | 366 } else { |
| 367 result.deltaY = scroll_delta; | 367 result.deltaY = scroll_delta; |
| 368 result.wheelTicksY = wheel_delta; | 368 result.wheelTicksY = wheel_delta; |
| 369 } | 369 } |
| 370 | 370 |
| 371 return result; | 371 return result; |
| 372 } | 372 } |
| 373 | 373 |
| 374 } // namespace ui | 374 } // namespace ui |
| OLD | NEW |