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

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

Issue 291003002: Move OverscrollController to RenderWidgetHostViewAura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK_GE Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/gesture_event_queue.h" 5 #include "content/browser/renderer_host/input/gesture_event_queue.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "content/browser/renderer_host/input/input_router.h" 9 #include "content/browser/renderer_host/input/input_router.h"
10 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h" 10 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return false; 86 return false;
87 } 87 }
88 return true; 88 return true;
89 } 89 }
90 } 90 }
91 91
92 // NOTE: The filters are applied successively. This simplifies the change. 92 // NOTE: The filters are applied successively. This simplifies the change.
93 bool GestureEventQueue::ShouldForward( 93 bool GestureEventQueue::ShouldForward(
94 const GestureEventWithLatencyInfo& gesture_event) { 94 const GestureEventWithLatencyInfo& gesture_event) {
95 TRACE_EVENT0("input", "GestureEventQueue::ShouldForward"); 95 TRACE_EVENT0("input", "GestureEventQueue::ShouldForward");
96 return ShouldForwardForZeroVelocityFlingStart(gesture_event) && 96 return ShouldForwardForBounceReduction(gesture_event) &&
97 ShouldForwardForBounceReduction(gesture_event) && 97 ShouldForwardForGFCFiltering(gesture_event) &&
98 ShouldForwardForGFCFiltering(gesture_event) && 98 ShouldForwardForTapSuppression(gesture_event) &&
99 ShouldForwardForTapSuppression(gesture_event) && 99 ShouldForwardForCoalescing(gesture_event);
100 ShouldForwardForCoalescing(gesture_event);
101 }
102
103 bool GestureEventQueue::ShouldForwardForZeroVelocityFlingStart(
104 const GestureEventWithLatencyInfo& gesture_event) const {
105 return gesture_event.event.type != WebInputEvent::GestureFlingStart ||
106 gesture_event.event.sourceDevice != WebGestureEvent::Touchpad ||
107 gesture_event.event.data.flingStart.velocityX != 0 ||
108 gesture_event.event.data.flingStart.velocityY != 0;
109 } 100 }
110 101
111 bool GestureEventQueue::ShouldForwardForGFCFiltering( 102 bool GestureEventQueue::ShouldForwardForGFCFiltering(
112 const GestureEventWithLatencyInfo& gesture_event) const { 103 const GestureEventWithLatencyInfo& gesture_event) const {
113 return gesture_event.event.type != WebInputEvent::GestureFlingCancel || 104 return gesture_event.event.type != WebInputEvent::GestureFlingCancel ||
114 !ShouldDiscardFlingCancelEvent(gesture_event); 105 !ShouldDiscardFlingCancelEvent(gesture_event);
115 } 106 }
116 107
117 bool GestureEventQueue::ShouldForwardForTapSuppression( 108 bool GestureEventQueue::ShouldForwardForTapSuppression(
118 const GestureEventWithLatencyInfo& gesture_event) { 109 const GestureEventWithLatencyInfo& gesture_event) {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return 0; 366 return 0;
376 367
377 if (!ignore_next_ack_) 368 if (!ignore_next_ack_)
378 return 1; 369 return 1;
379 370
380 DCHECK_GT(coalesced_gesture_events_.size(), 1U); 371 DCHECK_GT(coalesced_gesture_events_.size(), 1U);
381 return 2; 372 return 2;
382 } 373 }
383 374
384 } // namespace content 375 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698