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

Unified Diff: content/browser/renderer_host/input/touch_event_queue.cc

Issue 172263007: [Android] Ensure slop-exceeding TouchMove's are sent to the renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug link fix Created 6 years, 10 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 | « no previous file | content/browser/renderer_host/input/touch_event_queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/touch_event_queue.cc
diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc
index 9924c903a26318e2d91e177f8ded5cf83e9b1a60..03fac0abd3dda6b61eb0233a69a2171810fe8802 100644
--- a/content/browser/renderer_host/input/touch_event_queue.cc
+++ b/content/browser/renderer_host/input/touch_event_queue.cc
@@ -176,9 +176,11 @@ class TouchEventQueue::TouchTimeoutHandler {
// a given slop region, unless the touchstart is preventDefault'ed.
class TouchEventQueue::TouchMoveSlopSuppressor {
public:
+ // TODO(jdduke): Remove int cast on suppression length, crbug.com/336807.
TouchMoveSlopSuppressor(double slop_suppression_length_dips)
- : slop_suppression_length_dips_squared_(slop_suppression_length_dips *
- slop_suppression_length_dips),
+ : slop_suppression_length_dips_squared_(
+ static_cast<int>(slop_suppression_length_dips) *
+ static_cast<int>(slop_suppression_length_dips)),
suppressing_touch_moves_(false) {}
bool FilterEvent(const WebTouchEvent& event) {
@@ -197,8 +199,10 @@ class TouchEventQueue::TouchMoveSlopSuppressor {
suppressing_touch_moves_ = false;
} else if (event.touchesLength == 1) {
// Movement outside of the slop region should terminate suppression.
- gfx::PointF position = gfx::Point(event.touches[0].position);
- if ((position - touch_sequence_start_position_).LengthSquared() >
+ // TODO(jdduke): Use strict inequality, crbug.com/336807.
+ gfx::PointF position(event.touches[0].position.x,
+ event.touches[0].position.y);
+ if ((position - touch_sequence_start_position_).LengthSquared() >=
slop_suppression_length_dips_squared_)
suppressing_touch_moves_ = false;
}
« no previous file with comments | « no previous file | content/browser/renderer_host/input/touch_event_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698