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.h" | 5 #include "ui/events/blink/web_input_event.h" |
| 6 | 6 |
| 7 #include "ui/events/base_event_utils.h" | 7 #include "ui/events/base_event_utils.h" |
| 8 #include "ui/events/blink/blink_event_util.h" | 8 #include "ui/events/blink/blink_event_util.h" |
| 9 #include "ui/events/blink/blink_features.h" | 9 #include "ui/events/blink/blink_features.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 420 webkit_event.button = blink::WebMouseEvent::Button::Left; | 420 webkit_event.button = blink::WebMouseEvent::Button::Left; |
| 421 if (button_flags & EF_MIDDLE_MOUSE_BUTTON) | 421 if (button_flags & EF_MIDDLE_MOUSE_BUTTON) |
| 422 webkit_event.button = blink::WebMouseEvent::Button::Middle; | 422 webkit_event.button = blink::WebMouseEvent::Button::Middle; |
| 423 if (button_flags & EF_RIGHT_MOUSE_BUTTON) | 423 if (button_flags & EF_RIGHT_MOUSE_BUTTON) |
| 424 webkit_event.button = blink::WebMouseEvent::Button::Right; | 424 webkit_event.button = blink::WebMouseEvent::Button::Right; |
| 425 | 425 |
| 426 webkit_event.clickCount = click_count; | 426 webkit_event.clickCount = click_count; |
| 427 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); | 427 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); |
| 428 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); | 428 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); |
| 429 webkit_event.force = event.pointer_details().force; | 429 webkit_event.force = event.pointer_details().force; |
| 430 webkit_event.tangentialPressure = event.pointer_details().tangentialPressure; | |
|
mustaq
2017/01/23 20:23:56
I think it's better to clamp the incoming values a
lanwei
2017/01/25 15:53:51
https://msdn.microsoft.com/en-us/library/windows/d
mustaq
2017/01/25 16:48:53
I remember seeing a DCHECK failure for an old Andr
| |
| 431 webkit_event.twist = event.pointer_details().twist; | |
| 430 webkit_event.pointerType = | 432 webkit_event.pointerType = |
| 431 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); | 433 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); |
| 432 | 434 |
| 433 return webkit_event; | 435 return webkit_event; |
| 434 } | 436 } |
| 435 | 437 |
| 436 blink::WebMouseWheelEvent MakeWebMouseWheelEventFromUiEvent( | 438 blink::WebMouseWheelEvent MakeWebMouseWheelEventFromUiEvent( |
| 437 const MouseWheelEvent& event) { | 439 const MouseWheelEvent& event) { |
| 438 blink::WebMouseWheelEvent webkit_event( | 440 blink::WebMouseWheelEvent webkit_event( |
| 439 blink::WebInputEvent::MouseWheel, | 441 blink::WebInputEvent::MouseWheel, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 451 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); | 453 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); |
| 452 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); | 454 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); |
| 453 webkit_event.force = event.pointer_details().force; | 455 webkit_event.force = event.pointer_details().force; |
| 454 webkit_event.pointerType = | 456 webkit_event.pointerType = |
| 455 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); | 457 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); |
| 456 | 458 |
| 457 return webkit_event; | 459 return webkit_event; |
| 458 } | 460 } |
| 459 | 461 |
| 460 } // namespace ui | 462 } // namespace ui |
| OLD | NEW |