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

Side by Side 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 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 #include "content/browser/renderer_host/input/touch_stream_tracker.h"
6
7 #include "content/common/input/web_touch_event_traits.h"
8
9 namespace content {
10
11 TouchStreamTracker::TouchStreamTracker()
12 : has_active_touch_stream_(false) {
13 }
14
15 TouchStreamTracker::~TouchStreamTracker() {
16 }
17
18 InputEventAckState TouchStreamTracker::FilterTouchEventFromStream(
19 const blink::WebTouchEvent& touch_event, TouchStream stream) {
20 if (has_active_touch_stream_ && active_touch_stream_ != stream)
21 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
22 has_active_touch_stream_ = true;
23 active_touch_stream_ = stream;
24 return INPUT_EVENT_ACK_STATE_UNKNOWN;
25 }
26
27 TouchStreamTracker::TouchStream TouchStreamTracker::OnTouchEventAck(
28 const TouchEventWithLatencyInfo& event, InputEventAckState ack_result) {
29 DCHECK(has_active_touch_stream_);
30 if (WebTouchEventTraits::IsTouchSequenceEnd(event.event))
31 has_active_touch_stream_ = false;
32 return active_touch_stream_;
33 }
34
35 } // namespace content
OLDNEW
« 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