Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 2834183002: Add time stamp to the constructor of the events (Closed)
Patch Set: Fix typos Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fe244f31ed0a4738cab40fe98fbfb637dbba6220 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 platform_time_stamp) {
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,
+ platform_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()
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698