OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/input/touch_event_queue.h" | 5 #include "content/browser/renderer_host/input/touch_event_queue.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
10 #include "content/browser/renderer_host/input/timeout_monitor.h" | 10 #include "content/browser/renderer_host/input/timeout_monitor.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // also a touch-move, then the events can be coalesced into a single event. | 413 // also a touch-move, then the events can be coalesced into a single event. |
414 if (touch_queue_.size() > 1) { | 414 if (touch_queue_.size() > 1) { |
415 CoalescedWebTouchEvent* last_event = touch_queue_.back(); | 415 CoalescedWebTouchEvent* last_event = touch_queue_.back(); |
416 if (last_event->CoalesceEventIfPossible(event)) | 416 if (last_event->CoalesceEventIfPossible(event)) |
417 return; | 417 return; |
418 } | 418 } |
419 touch_queue_.push_back(new CoalescedWebTouchEvent(event, false)); | 419 touch_queue_.push_back(new CoalescedWebTouchEvent(event, false)); |
420 } | 420 } |
421 | 421 |
422 void TouchEventQueue::ProcessTouchAck(InputEventAckState ack_result, | 422 void TouchEventQueue::ProcessTouchAck(InputEventAckState ack_result, |
423 const LatencyInfo& latency_info) { | 423 const LatencyInfo& latency_info, |
| 424 uint64 unique_touch_event_id) { |
424 TRACE_EVENT0("input", "TouchEventQueue::ProcessTouchAck"); | 425 TRACE_EVENT0("input", "TouchEventQueue::ProcessTouchAck"); |
425 | 426 |
426 DCHECK(!dispatching_touch_ack_); | 427 DCHECK(!dispatching_touch_ack_); |
427 dispatching_touch_ = false; | 428 dispatching_touch_ = false; |
428 | 429 |
429 if (timeout_handler_ && timeout_handler_->ConfirmTouchEvent(ack_result)) | 430 if (timeout_handler_ && timeout_handler_->ConfirmTouchEvent(ack_result)) |
430 return; | 431 return; |
431 | 432 |
432 touchmove_slop_suppressor_->ConfirmTouchEvent(ack_result); | 433 touchmove_slop_suppressor_->ConfirmTouchEvent(ack_result); |
433 | 434 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) | 751 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
751 send_touch_events_async_ = false; | 752 send_touch_events_async_ = false; |
752 has_handler_for_current_sequence_ |= | 753 has_handler_for_current_sequence_ |= |
753 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 754 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
754 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { | 755 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { |
755 has_handler_for_current_sequence_ = false; | 756 has_handler_for_current_sequence_ = false; |
756 } | 757 } |
757 } | 758 } |
758 | 759 |
759 } // namespace content | 760 } // namespace content |
OLD | NEW |