Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |