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

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

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.h
diff --git a/content/browser/renderer_host/input/touch_stream_tracker.h b/content/browser/renderer_host/input/touch_stream_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..3c63f3c4042b87233413b027b66817e715ce759e
--- /dev/null
+++ b/content/browser/renderer_host/input/touch_stream_tracker.h
@@ -0,0 +1,43 @@
+// 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.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_STREAM_TRACKER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_STREAM_TRACKER_H_
+
+#include "content/browser/renderer_host/event_with_latency_info.h"
+#include "content/common/input/input_event_ack_state.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
+
+namespace content {
+
+// Tracks multiple touch streams and filters events from all other streams
+// while one is active.
+class CONTENT_EXPORT TouchStreamTracker {
+ public:
+ enum TouchStream {
+ NATIVE_STREAM,
+ EMULATED_STREAM
+ };
+
+ TouchStreamTracker();
+ virtual ~TouchStreamTracker();
+
+ // Tracker may immediately ack touch event if another touch stream is active.
+ InputEventAckState FilterTouchEventFromStream(
+ const blink::WebTouchEvent& touch_event, TouchStream stream);
+
+ // Returns the touch stream which should receive this ack.
+ TouchStream OnTouchEventAck(
+ const TouchEventWithLatencyInfo& event, InputEventAckState ack_result);
+
+ private:
+ bool has_active_touch_stream_;
+ TouchStream active_touch_stream_;
+
+ DISALLOW_COPY_AND_ASSIGN(TouchStreamTracker);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_

Powered by Google App Engine
This is Rietveld 408576698