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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_STREAM_TRACKER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_STREAM_TRACKER_H_
7
8 #include "content/browser/renderer_host/event_with_latency_info.h"
9 #include "content/common/input/input_event_ack_state.h"
10 #include "third_party/WebKit/public/web/WebInputEvent.h"
11
12 namespace content {
13
14 // Tracks multiple touch streams and filters events from all other streams
15 // while one is active.
16 class CONTENT_EXPORT TouchStreamTracker {
17 public:
18 enum TouchStream {
19 NATIVE_STREAM,
20 EMULATED_STREAM
21 };
22
23 TouchStreamTracker();
24 virtual ~TouchStreamTracker();
25
26 // Tracker may immediately ack touch event if another touch stream is active.
27 InputEventAckState FilterTouchEventFromStream(
28 const blink::WebTouchEvent& touch_event, TouchStream stream);
29
30 // Returns the touch stream which should receive this ack.
31 TouchStream OnTouchEventAck(
32 const TouchEventWithLatencyInfo& event, InputEventAckState ack_result);
33
34 private:
35 bool has_active_touch_stream_;
36 TouchStream active_touch_stream_;
37
38 DISALLOW_COPY_AND_ASSIGN(TouchStreamTracker);
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EMULATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698