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

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

Issue 679633005: Expose native, desktop and mobile gesture detection defaults (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 6 years 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 | « content/browser/renderer_host/ui_events_helper.cc ('k') | content/common/input/web_input_event_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d3addb67918cc46a16e8e14ec3124a9db9aa6f88..ab2968a771558559bfede191c77217f6ea4e5c78 100644
--- a/content/common/input/synthetic_web_input_event_builders.cc
+++ b/content/common/input/synthetic_web_input_event_builders.cc
@@ -163,6 +163,7 @@ void SyntheticWebTouchEvent::ResetPoints() {
}
touchesLength = point;
type = WebInputEvent::Undefined;
+ causesScrollingIfUncanceled = false;
}
int SyntheticWebTouchEvent::PressPoint(float x, float y) {
@@ -181,7 +182,11 @@ int SyntheticWebTouchEvent::PressPoint(float x, float y) {
}
void SyntheticWebTouchEvent::MovePoint(int index, float x, float y) {
- CHECK(index >= 0 && index < touchesLengthCap);
+ CHECK_GE(index, 0);
+ CHECK_LT(index, touchesLengthCap);
+ // Always set this bit to avoid otherwise unexpected touchmove suppression.
+ // The caller can opt-out explicitly, if necessary.
+ causesScrollingIfUncanceled = true;
WebTouchPoint& point = touches[index];
point.position.x = point.screenPosition.x = x;
point.position.y = point.screenPosition.y = y;
@@ -191,14 +196,16 @@ void SyntheticWebTouchEvent::MovePoint(int index, float x, float y) {
}
void SyntheticWebTouchEvent::ReleasePoint(int index) {
- CHECK(index >= 0 && index < touchesLengthCap);
+ CHECK_GE(index, 0);
+ CHECK_LT(index, touchesLengthCap);
touches[index].state = WebTouchPoint::StateReleased;
WebTouchEventTraits::ResetType(
WebInputEvent::TouchEnd, timeStampSeconds, this);
}
void SyntheticWebTouchEvent::CancelPoint(int index) {
- CHECK(index >= 0 && index < touchesLengthCap);
+ CHECK_GE(index, 0);
+ CHECK_LT(index, touchesLengthCap);
touches[index].state = WebTouchPoint::StateCancelled;
WebTouchEventTraits::ResetType(
WebInputEvent::TouchCancel, timeStampSeconds, this);
« no previous file with comments | « content/browser/renderer_host/ui_events_helper.cc ('k') | content/common/input/web_input_event_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698