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

Unified Diff: content/common/input/synthetic_web_input_event_builders.cc

Issue 247433003: Mark touchcancel events as uncancelable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: avi CR feedback Created 6 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
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
« no previous file with comments | « content/common/input/synthetic_web_input_event_builders.h ('k') | content/common/input/web_touch_event_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698