| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 } | 619 } |
| 620 | 620 |
| 621 void TouchEventQueue::OnHasTouchEventHandlers(bool has_handlers) { | 621 void TouchEventQueue::OnHasTouchEventHandlers(bool has_handlers) { |
| 622 DCHECK(!dispatching_touch_ack_); | 622 DCHECK(!dispatching_touch_ack_); |
| 623 DCHECK(!dispatching_touch_); | 623 DCHECK(!dispatching_touch_); |
| 624 | 624 |
| 625 if (has_handlers) { | 625 if (has_handlers) { |
| 626 if (touch_filtering_state_ == DROP_ALL_TOUCHES) { | 626 if (touch_filtering_state_ == DROP_ALL_TOUCHES) { |
| 627 // If no touch handler was previously registered, ensure that we don't | 627 // If no touch handler was previously registered, ensure that we don't |
| 628 // send a partial touch sequence to the renderer. | 628 // send a partial touch sequence to the renderer. |
| 629 DCHECK(touch_queue_.empty()); | |
| 630 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; | 629 touch_filtering_state_ = DROP_TOUCHES_IN_SEQUENCE; |
| 631 } | 630 } |
| 632 } else { | 631 } else { |
| 633 // TODO(jdduke): Synthesize a TouchCancel if necessary to update Blink touch | 632 // 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 | 633 // state tracking and/or touch-action filtering (e.g., if the touch handler |
| 635 // was removed mid-sequence), crbug.com/375940. | 634 // was removed mid-sequence), crbug.com/375940. |
| 636 touch_filtering_state_ = DROP_ALL_TOUCHES; | 635 touch_filtering_state_ = DROP_ALL_TOUCHES; |
| 637 pending_async_touchmove_.reset(); | 636 pending_async_touchmove_.reset(); |
| 638 if (timeout_handler_) | 637 if (timeout_handler_) |
| 639 timeout_handler_->Reset(); | 638 timeout_handler_->Reset(); |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 iter != end; | 815 iter != end; |
| 817 ++iter) { | 816 ++iter) { |
| 818 if (iter->second != ack_state) | 817 if (iter->second != ack_state) |
| 819 return false; | 818 return false; |
| 820 } | 819 } |
| 821 | 820 |
| 822 return true; | 821 return true; |
| 823 } | 822 } |
| 824 | 823 |
| 825 } // namespace content | 824 } // namespace content |
| OLD | NEW |