Chromium Code Reviews| Index: ui/events/blink/blink_event_util.cc |
| diff --git a/ui/events/blink/blink_event_util.cc b/ui/events/blink/blink_event_util.cc |
| index b389600f23b33709d46b444a4dcb420368403f6b..a97284cb82fb984ab9eea0e508fe038e10e72761 100644 |
| --- a/ui/events/blink/blink_event_util.cc |
| +++ b/ui/events/blink/blink_event_util.cc |
| @@ -71,10 +71,29 @@ WebTouchPoint::State ToWebTouchPointState(const MotionEvent& event, |
| return WebTouchPoint::StateUndefined; |
| } |
| +WebTouchPoint::PointerType ToWebTouchPointPointerType( |
| + const MotionEvent& event, size_t pointer_index) { |
| + switch (event.GetToolType(pointer_index)) { |
| + case MotionEvent::TOOL_TYPE_UNKNOWN: |
| + return WebTouchPoint::PointerTypeUnknown; |
| + case MotionEvent::TOOL_TYPE_FINGER: |
| + return WebTouchPoint::PointerTypeTouch; |
| + case MotionEvent::TOOL_TYPE_STYLUS: |
| + return WebTouchPoint::PointerTypePen; |
| + case MotionEvent::TOOL_TYPE_MOUSE: |
| + return WebTouchPoint::PointerTypeMouse; |
| + case MotionEvent::TOOL_TYPE_ERASER: |
| + return WebTouchPoint::PointerTypeUnknown; |
| + } |
| + NOTREACHED(); |
|
sadrul
2015/08/11 19:33:34
NOTREACHED() << "Invalid MotionEvent::ToolType = "
USE eero AT chromium.org
2015/08/12 07:50:11
Done.
|
| + return WebTouchPoint::PointerTypeUnknown; |
| +} |
| + |
| WebTouchPoint CreateWebTouchPoint(const MotionEvent& event, |
| size_t pointer_index) { |
| WebTouchPoint touch; |
| touch.id = event.GetPointerId(pointer_index); |
| + touch.pointerType = ToWebTouchPointPointerType(event, pointer_index); |
| touch.state = ToWebTouchPointState(event, pointer_index); |
| touch.position.x = event.GetX(pointer_index); |
| touch.position.y = event.GetY(pointer_index); |