Index: content/common/input/synthetic_web_input_event_builders.cc |
diff --git a/content/common/input/synthetic_web_input_event_builders.cc b/content/common/input/synthetic_web_input_event_builders.cc |
index f5a8aa3f212d56e09cdc7fbae8a3127a1c90ee5d..1bdea994878ebc401e5949d0304dd2189674c947 100644 |
--- a/content/common/input/synthetic_web_input_event_builders.cc |
+++ b/content/common/input/synthetic_web_input_event_builders.cc |
@@ -5,6 +5,7 @@ |
#include "content/common/input/synthetic_web_input_event_builders.h" |
#include "base/logging.h" |
+#include "content/common/input/web_touch_event_traits.h" |
#include "ui/events/keycodes/keyboard_codes.h" |
namespace content { |
@@ -169,7 +170,8 @@ int SyntheticWebTouchEvent::PressPoint(float x, float y) { |
point.state = WebTouchPoint::StatePressed; |
point.radiusX = point.radiusY = 1.f; |
++touchesLength; |
- type = WebInputEvent::TouchStart; |
+ WebTouchEventTraits::ResetType( |
+ WebInputEvent::TouchStart, timeStampSeconds, this); |
return point.id; |
} |
@@ -179,31 +181,26 @@ void SyntheticWebTouchEvent::MovePoint(int index, float x, float y) { |
point.position.x = point.screenPosition.x = x; |
point.position.y = point.screenPosition.y = y; |
touches[index].state = WebTouchPoint::StateMoved; |
- type = WebInputEvent::TouchMove; |
+ WebTouchEventTraits::ResetType( |
+ WebInputEvent::TouchMove, timeStampSeconds, this); |
} |
void SyntheticWebTouchEvent::ReleasePoint(int index) { |
CHECK(index >= 0 && index < touchesLengthCap); |
touches[index].state = WebTouchPoint::StateReleased; |
- type = WebInputEvent::TouchEnd; |
+ WebTouchEventTraits::ResetType( |
+ WebInputEvent::TouchEnd, timeStampSeconds, this); |
} |
void SyntheticWebTouchEvent::CancelPoint(int index) { |
CHECK(index >= 0 && index < touchesLengthCap); |
touches[index].state = WebTouchPoint::StateCancelled; |
- type = WebInputEvent::TouchCancel; |
+ WebTouchEventTraits::ResetType( |
+ WebInputEvent::TouchCancel, timeStampSeconds, this); |
} |
void SyntheticWebTouchEvent::SetTimestamp(base::TimeDelta timestamp) { |
timeStampSeconds = timestamp.InSecondsF(); |
} |
-SyntheticWebTouchEvent SyntheticWebTouchEventBuilder::Build( |
- WebInputEvent::Type type) { |
- DCHECK(WebInputEvent::isTouchEventType(type)); |
- SyntheticWebTouchEvent result; |
- result.type = type; |
- return result; |
-}; |
- |
} // namespace content |