Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: content/browser/renderer_host/input/touch_event_queue.cc

Issue 1645613007: Redefined the bit WebTouchEvent.causesScrollingIfUncanceled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed an aura unittest. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 if (event.type == WebInputEvent::TouchEnd || 303 if (event.type == WebInputEvent::TouchEnd ||
304 event.type == WebInputEvent::TouchCancel) 304 event.type == WebInputEvent::TouchCancel)
305 suppressing_touchmoves_ = false; 305 suppressing_touchmoves_ = false;
306 306
307 if (event.type != WebInputEvent::TouchMove) 307 if (event.type != WebInputEvent::TouchMove)
308 return false; 308 return false;
309 309
310 if (suppressing_touchmoves_) { 310 if (suppressing_touchmoves_) {
311 if (event.touchesLength > 1) { 311 if (event.touchesLength > 1) {
312 suppressing_touchmoves_ = false; 312 suppressing_touchmoves_ = false;
313 } else if (event.causesScrollingIfUncanceled) { 313 } else if (event.movedBeyondSlopRegion) {
314 suppressing_touchmoves_ = false; 314 suppressing_touchmoves_ = false;
315 } else { 315 } else {
316 // No sane slop region should be larger than 60 DIPs. 316 // No sane slop region should be larger than 60 DIPs.
317 DCHECK_LT((gfx::PointF(event.touches[0].position) - 317 DCHECK_LT((gfx::PointF(event.touches[0].position) -
318 touch_start_location_).LengthSquared(), 318 touch_start_location_).LengthSquared(),
319 kMaxConceivablePlatformSlopRegionLengthDipsSquared); 319 kMaxConceivablePlatformSlopRegionLengthDipsSquared);
320 } 320 }
321 } 321 }
322 322
323 return suppressing_touchmoves_; 323 return suppressing_touchmoves_;
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) 878 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED)
879 send_touch_events_async_ = false; 879 send_touch_events_async_ = false;
880 has_handler_for_current_sequence_ |= 880 has_handler_for_current_sequence_ |=
881 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; 881 ack_result != INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
882 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) { 882 } else if (WebTouchEventTraits::IsTouchSequenceEnd(event)) {
883 has_handler_for_current_sequence_ = false; 883 has_handler_for_current_sequence_ = false;
884 } 884 }
885 } 885 }
886 886
887 } // namespace content 887 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698