Chromium Code Reviews| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 bool sequence_using_mobile_timeout_; | 285 bool sequence_using_mobile_timeout_; |
| 286 }; | 286 }; |
| 287 | 287 |
| 288 // Provides touchmove slop suppression for a touch sequence until a | 288 // Provides touchmove slop suppression for a touch sequence until a |
| 289 // (unprevented) touch will trigger immediate scrolling. | 289 // (unprevented) touch will trigger immediate scrolling. |
| 290 class TouchEventQueue::TouchMoveSlopSuppressor { | 290 class TouchEventQueue::TouchMoveSlopSuppressor { |
| 291 public: | 291 public: |
| 292 TouchMoveSlopSuppressor() : suppressing_touchmoves_(false) {} | 292 TouchMoveSlopSuppressor() : suppressing_touchmoves_(false) {} |
| 293 | 293 |
| 294 bool FilterEvent(const WebTouchEvent& event) { | 294 bool FilterEvent(const WebTouchEvent& event) { |
| 295 return false; | |
|
mustaq
2017/02/09 22:00:04
Please remove the rest of the function body. Other
| |
| 296 | |
| 295 if (WebTouchEventTraits::IsTouchSequenceStart(event)) { | 297 if (WebTouchEventTraits::IsTouchSequenceStart(event)) { |
| 296 suppressing_touchmoves_ = true; | 298 suppressing_touchmoves_ = true; |
| 297 touch_start_location_ = gfx::PointF(event.touches[0].position); | 299 touch_start_location_ = gfx::PointF(event.touches[0].position); |
| 298 } | 300 } |
| 299 | 301 |
| 300 if (event.type() == WebInputEvent::TouchEnd || | 302 if (event.type() == WebInputEvent::TouchEnd || |
| 301 event.type() == WebInputEvent::TouchCancel) | 303 event.type() == WebInputEvent::TouchCancel) |
| 302 suppressing_touchmoves_ = false; | 304 suppressing_touchmoves_ = false; |
| 303 | 305 |
| 304 if (event.type() != WebInputEvent::TouchMove) | 306 if (event.type() != WebInputEvent::TouchMove) |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 936 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) | 938 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
| 937 send_touch_events_async_ = false; | 939 send_touch_events_async_ = false; |
| 938 has_handler_for_current_sequence_ |= | 940 has_handler_for_current_sequence_ |= |
| 939 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 941 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 940 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { | 942 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { |
| 941 has_handler_for_current_sequence_ = false; | 943 has_handler_for_current_sequence_ = false; |
| 942 } | 944 } |
| 943 } | 945 } |
| 944 | 946 |
| 945 } // namespace content | 947 } // namespace content |
| OLD | NEW |