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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "content/browser/renderer_host/input/timeout_monitor.h" | 10 #include "content/browser/renderer_host/input/timeout_monitor.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; | 630 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; |
631 } | 631 } |
632 } else { | 632 } else { |
633 // TODO(jdduke): Synthesize a TouchCancel if necessary to update Blink touch | 633 // TODO(jdduke): Synthesize a TouchCancel if necessary to update Blink touch |
634 // state tracking and/or touch-action filtering (e.g., if the touch handler | 634 // state tracking and/or touch-action filtering (e.g., if the touch handler |
635 // was removed mid-sequence), crbug.com/375940. | 635 // was removed mid-sequence), crbug.com/375940. |
636 touch_filtering_state_ = DROP_ALL_TOUCHES; | 636 touch_filtering_state_ = DROP_ALL_TOUCHES; |
637 pending_async_touchmove_.reset(); | 637 pending_async_touchmove_.reset(); |
638 if (timeout_handler_) | 638 if (timeout_handler_) |
639 timeout_handler_->Reset(); | 639 timeout_handler_->Reset(); |
640 if (!touch_queue_.empty()) | |
641 ProcessTouchAck(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, LatencyInfo()); | |
642 // As there is no touch handler, ack'ing the event should flush the queue. | |
643 DCHECK(touch_queue_.empty()); | |
644 } | 640 } |
645 } | 641 } |
646 | 642 |
647 bool TouchEventQueue::IsPendingAckTouchStart() const { | 643 bool TouchEventQueue::IsPendingAckTouchStart() const { |
648 DCHECK(!dispatching_touch_ack_); | 644 DCHECK(!dispatching_touch_ack_); |
649 if (touch_queue_.empty()) | 645 if (touch_queue_.empty()) |
650 return false; | 646 return false; |
651 | 647 |
652 const blink::WebTouchEvent& event = | 648 const blink::WebTouchEvent& event = |
653 touch_queue_.front()->coalesced_event().event; | 649 touch_queue_.front()->coalesced_event().event; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 iter != end; | 816 iter != end; |
821 ++iter) { | 817 ++iter) { |
822 if (iter->second != ack_state) | 818 if (iter->second != ack_state) |
823 return false; | 819 return false; |
824 } | 820 } |
825 | 821 |
826 return true; | 822 return true; |
827 } | 823 } |
828 | 824 |
829 } // namespace content | 825 } // namespace content |
OLD | NEW |