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

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

Issue 375863005: Touch emulator: allow multiple touch streams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better touch sequence end check Created 6 years, 5 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/browser/renderer_host/input/touch_stream_tracker.cc
diff --git a/content/browser/renderer_host/input/touch_stream_tracker.cc b/content/browser/renderer_host/input/touch_stream_tracker.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bc6c627cabc93812a3b11b55c25ba5086eee851c
--- /dev/null
+++ b/content/browser/renderer_host/input/touch_stream_tracker.cc
@@ -0,0 +1,35 @@
+// 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/touch_stream_tracker.h"
+
+#include "content/common/input/web_touch_event_traits.h"
+
+namespace content {
+
+TouchStreamTracker::TouchStreamTracker()
+ : has_active_touch_stream_(false) {
+}
+
+TouchStreamTracker::~TouchStreamTracker() {
+}
+
+InputEventAckState TouchStreamTracker::FilterTouchEventFromStream(
+ const blink::WebTouchEvent& touch_event, TouchStream stream) {
+ if (has_active_touch_stream_ && active_touch_stream_ != stream)
+ return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
jdduke (slow) 2014/07/10 14:52:58 We probably want to return INPUT_EVENT_ACK_STATE_C
+ has_active_touch_stream_ = true;
+ active_touch_stream_ = stream;
+ return INPUT_EVENT_ACK_STATE_UNKNOWN;
+}
+
+TouchStreamTracker::TouchStream TouchStreamTracker::OnTouchEventAck(
+ const TouchEventWithLatencyInfo& event, InputEventAckState ack_result) {
+ DCHECK(has_active_touch_stream_);
+ if (WebTouchEventTraits::IsTouchSequenceEnd(event.event))
+ has_active_touch_stream_ = false;
+ return active_touch_stream_;
+}
+
+} // namespace content
« no previous file with comments | « content/browser/renderer_host/input/touch_stream_tracker.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698