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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 const TouchEventWithLatencyInfo& | 513 const TouchEventWithLatencyInfo& |
514 TouchEventQueue::GetLatestEventForTesting() const { | 514 TouchEventQueue::GetLatestEventForTesting() const { |
515 return touch_queue_.back()->coalesced_event(); | 515 return touch_queue_.back()->coalesced_event(); |
516 } | 516 } |
517 | 517 |
518 void TouchEventQueue::FlushQueue() { | 518 void TouchEventQueue::FlushQueue() { |
519 DCHECK(!dispatching_touch_ack_); | 519 DCHECK(!dispatching_touch_ack_); |
520 DCHECK(!dispatching_touch_); | 520 DCHECK(!dispatching_touch_); |
521 if (touch_filtering_state_ != DROP_ALL_TOUCHES) | 521 if (touch_filtering_state_ != DROP_ALL_TOUCHES) |
522 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; | 522 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; |
523 while (!touch_queue_.empty()) | 523 while (!touch_queue_.empty()) { |
524 PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, LatencyInfo()); | 524 PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, |
| 525 LatencyInfo()); |
| 526 } |
525 } | 527 } |
526 | 528 |
527 void TouchEventQueue::PopTouchEventToClient( | 529 void TouchEventQueue::PopTouchEventToClient( |
528 InputEventAckState ack_result, | 530 InputEventAckState ack_result, |
529 const LatencyInfo& renderer_latency_info) { | 531 const LatencyInfo& renderer_latency_info) { |
530 DCHECK(!dispatching_touch_ack_); | 532 DCHECK(!dispatching_touch_ack_); |
531 if (touch_queue_.empty()) | 533 if (touch_queue_.empty()) |
532 return; | 534 return; |
533 scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front()); | 535 scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front()); |
534 touch_queue_.pop_front(); | 536 touch_queue_.pop_front(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 } else if (event.type == WebInputEvent::TouchStart) { | 611 } else if (event.type == WebInputEvent::TouchStart) { |
610 for (unsigned i = 0; i < event.touchesLength; ++i) { | 612 for (unsigned i = 0; i < event.touchesLength; ++i) { |
611 const WebTouchPoint& point = event.touches[i]; | 613 const WebTouchPoint& point = event.touches[i]; |
612 if (point.state == WebTouchPoint::StatePressed) | 614 if (point.state == WebTouchPoint::StatePressed) |
613 touch_ack_states_[point.id] = ack_result; | 615 touch_ack_states_[point.id] = ack_result; |
614 } | 616 } |
615 } | 617 } |
616 } | 618 } |
617 | 619 |
618 } // namespace content | 620 } // namespace content |
OLD | NEW |