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

Unified Diff: content/renderer/gpu/input_handler_proxy.cc

Issue 76283003: touch: Fix touch-event hit-testing for multiple touch points. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 7 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
Index: content/renderer/gpu/input_handler_proxy.cc
diff --git a/content/renderer/gpu/input_handler_proxy.cc b/content/renderer/gpu/input_handler_proxy.cc
index 434cfd29a01a4cd7118dd8d7d36435f02065fe21..4a71410c4b734c88e27b040568b55e03ee2064e4 100644
--- a/content/renderer/gpu/input_handler_proxy.cc
+++ b/content/renderer/gpu/input_handler_proxy.cc
@@ -21,6 +21,7 @@ using blink::WebMouseEvent;
using blink::WebMouseWheelEvent;
using blink::WebPoint;
using blink::WebTouchEvent;
+using blink::WebTouchPoint;
namespace {
@@ -227,9 +228,14 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent(
} else if (event.type == WebInputEvent::TouchStart) {
const WebTouchEvent& touch_event =
*static_cast<const WebTouchEvent*>(&event);
- if (!input_handler_->HaveTouchEventHandlersAt(touch_event.touches[0]
- .position))
- return DROP_EVENT;
+ for (unsigned i = 0; i < touch_event.touchesLength; ++i) {
jamesr 2013/12/03 00:44:38 can you use size_t for indexing? unsigned works gi
sadrul 2013/12/03 03:20:00 Done.
+ if (touch_event.touches[i].state != WebTouchPoint::StatePressed)
+ continue;
+ if (input_handler_->HaveTouchEventHandlersAt(touch_event.touches[i]
+ .position))
+ return DID_NOT_HANDLE;
+ }
+ return DROP_EVENT;
} else if (WebInputEvent::isKeyboardEventType(event.type)) {
CancelCurrentFling();
} else if (event.type == WebInputEvent::MouseMove) {

Powered by Google App Engine
This is Rietveld 408576698