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

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

Issue 171283002: Always reset touch action at the beginning of a new gesture sequence (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test name. 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 | « content/browser/renderer_host/input/web_touch_event_traits.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/web_touch_event_traits.cc
diff --git a/content/browser/renderer_host/input/web_touch_event_traits.cc b/content/browser/renderer_host/input/web_touch_event_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b2bc085a94818d138fa611b7b1f7437678336d3f
--- /dev/null
+++ b/content/browser/renderer_host/input/web_touch_event_traits.cc
@@ -0,0 +1,27 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/renderer_host/input/web_touch_event_traits.h"
+
+#include "base/logging.h"
+
+using blink::WebInputEvent;
+using blink::WebTouchEvent;
+
+namespace content {
+
+bool WebTouchEventTraits::IsTouchSequenceStart(const WebTouchEvent& event) {
+ if (event.type != WebInputEvent::TouchStart)
+ return false;
+ DCHECK(event.touchesLength);
+ if (!event.touchesLength)
+ return false;
+ for (size_t i = 0; i < event.touchesLength; i++) {
+ if (event.touches[i].state != blink::WebTouchPoint::StatePressed)
+ return false;
+ }
+ return true;
+}
+
+} // namespace content
« no previous file with comments | « content/browser/renderer_host/input/web_touch_event_traits.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698