| 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/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/events/event_utils.h" | 10 #include "ui/events/event_utils.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType( | 33 blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType( |
| 34 EventPointerType pointer_type) { | 34 EventPointerType pointer_type) { |
| 35 switch (pointer_type) { | 35 switch (pointer_type) { |
| 36 case EventPointerType::POINTER_TYPE_UNKNOWN: | 36 case EventPointerType::POINTER_TYPE_UNKNOWN: |
| 37 return blink::WebPointerProperties::PointerType::Unknown; | 37 return blink::WebPointerProperties::PointerType::Unknown; |
| 38 case EventPointerType::POINTER_TYPE_MOUSE: | 38 case EventPointerType::POINTER_TYPE_MOUSE: |
| 39 return blink::WebPointerProperties::PointerType::Mouse; | 39 return blink::WebPointerProperties::PointerType::Mouse; |
| 40 case EventPointerType::POINTER_TYPE_PEN: | 40 case EventPointerType::POINTER_TYPE_PEN: |
| 41 return blink::WebPointerProperties::PointerType::Pen; |
| 41 case EventPointerType::POINTER_TYPE_ERASER: | 42 case EventPointerType::POINTER_TYPE_ERASER: |
| 42 return blink::WebPointerProperties::PointerType::Pen; | 43 return blink::WebPointerProperties::PointerType::Eraser; |
| 43 case EventPointerType::POINTER_TYPE_TOUCH: | 44 case EventPointerType::POINTER_TYPE_TOUCH: |
| 44 return blink::WebPointerProperties::PointerType::Touch; | 45 return blink::WebPointerProperties::PointerType::Touch; |
| 45 } | 46 } |
| 46 NOTREACHED() << "Unexpected EventPointerType"; | 47 NOTREACHED() << "Unexpected EventPointerType"; |
| 47 return blink::WebPointerProperties::PointerType::Unknown; | 48 return blink::WebPointerProperties::PointerType::Unknown; |
| 48 } | 49 } |
| 49 | 50 |
| 50 // Creates a WebGestureEvent from a GestureEvent. Note that it does not | 51 // Creates a WebGestureEvent from a GestureEvent. Note that it does not |
| 51 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So | 52 // populate the event coordinates (i.e. |x|, |y|, |globalX|, and |globalY|). So |
| 52 // the caller must populate these fields. | 53 // the caller must populate these fields. |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); | 455 webkit_event.tiltX = roundf(event.pointer_details().tilt_x); |
| 455 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); | 456 webkit_event.tiltY = roundf(event.pointer_details().tilt_y); |
| 456 webkit_event.force = event.pointer_details().force; | 457 webkit_event.force = event.pointer_details().force; |
| 457 webkit_event.pointerType = | 458 webkit_event.pointerType = |
| 458 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); | 459 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type); |
| 459 | 460 |
| 460 return webkit_event; | 461 return webkit_event; |
| 461 } | 462 } |
| 462 | 463 |
| 463 } // namespace ui | 464 } // namespace ui |
| OLD | NEW |