Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| index 51501f37e039a2bf257d43cb321a63cd0b8543d6..ce1f4e64047552ec2ae3ca40b09586ace42ef103 100644 |
| --- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| +++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
| @@ -33,15 +33,18 @@ bool IsInDocument(EventTarget* n) { |
| return n && n->ToNode() && n->ToNode()->isConnected(); |
| } |
| -Vector<WebTouchPoint> GetCoalescedPoints( |
| +Vector<std::pair<WebTouchPoint, TimeTicks>> GetCoalescedPoints( |
| const Vector<WebTouchEvent>& coalesced_events, |
| int id) { |
| - Vector<WebTouchPoint> related_points; |
| + Vector<std::pair<WebTouchPoint, TimeTicks>> related_points; |
| for (const auto& touch_event : coalesced_events) { |
| for (unsigned i = 0; i < touch_event.touches_length; ++i) { |
| if (touch_event.touches[i].id == id && |
| - touch_event.touches[i].state != WebTouchPoint::kStateStationary) |
| - related_points.push_back(touch_event.TouchPointInRootFrame(i)); |
| + touch_event.touches[i].state != WebTouchPoint::kStateStationary) { |
| + related_points.push_back(std::pair<WebTouchPoint, TimeTicks>( |
| + touch_event.TouchPointInRootFrame(i), |
| + TimeTicks::FromSeconds(touch_event.TimeStampSeconds()))); |
| + } |
| } |
| } |
| return related_points; |
| @@ -236,7 +239,7 @@ void PointerEventManager::SetNodeUnderPointer(PointerEvent* pointer_event, |
| } |
| } |
| -void PointerEventManager::BlockTouchPointers() { |
| +void PointerEventManager::BlockTouchPointers(TimeTicks platfrom_time_stamp) { |
|
dtapuska
2017/04/24 15:27:43
s/platfrom/platform/
Navid Zolghadr
2017/04/24 15:51:45
Done.
|
| if (in_canceled_state_for_pointer_type_touch_) |
| return; |
| in_canceled_state_for_pointer_type_touch_ = true; |
| @@ -247,7 +250,8 @@ void PointerEventManager::BlockTouchPointers() { |
| for (int pointer_id : touch_pointer_ids) { |
| PointerEvent* pointer_event = |
| pointer_event_factory_.CreatePointerCancelEvent( |
| - pointer_id, WebPointerProperties::PointerType::kTouch); |
| + pointer_id, WebPointerProperties::PointerType::kTouch, |
| + platfrom_time_stamp); |
| DCHECK(node_under_pointer_.Contains(pointer_id)); |
| EventTarget* target = node_under_pointer_.at(pointer_id).target; |
| @@ -280,7 +284,7 @@ WebInputEventResult PointerEventManager::HandleTouchEvents( |
| const WebTouchEvent& event, |
| const Vector<WebTouchEvent>& coalesced_events) { |
| if (event.GetType() == WebInputEvent::kTouchScrollStarted) { |
| - BlockTouchPointers(); |
| + BlockTouchPointers(TimeTicks::FromSeconds(event.TimeStampSeconds())); |
| return WebInputEventResult::kHandledSystem; |
| } |
| @@ -392,6 +396,7 @@ void PointerEventManager::DispatchTouchPointerEvents( |
| PointerEvent* pointer_event = pointer_event_factory_.Create( |
| touch_point, GetCoalescedPoints(coalesced_events, touch_point.id), |
| static_cast<WebInputEvent::Modifiers>(event.GetModifiers()), |
| + TimeTicks::FromSeconds(event.TimeStampSeconds()), |
| touch_info.target_frame, |
| touch_info.touch_node |
| ? touch_info.touch_node->GetDocument().domWindow() |