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

Unified Diff: ui/events/blink/input_handler_proxy.cc

Issue 2472943003: Revert "Touchpad scroll latching enabled for Mac behind flag." (Closed)
Patch Set: Better merge. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/input/mouse_wheel_event_queue_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/input_handler_proxy.cc
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index 81b1d09911abf69a624d484dda6ed4121f5aea52..dc43bfb9f26ab71cdae5c1dfb83f81abfc428156 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -133,12 +133,6 @@ cc::ScrollState CreateScrollStateForGesture(const WebGestureEvent& event) {
scroll_state_data.position_x = event.x;
scroll_state_data.position_y = event.y;
scroll_state_data.is_beginning = true;
- // On Mac, a GestureScrollBegin in the inertial phase indicates a fling
- // start.
- if (event.data.scrollBegin.inertialPhase ==
- WebGestureEvent::MomentumPhase) {
- scroll_state_data.is_in_inertial_phase = true;
- }
break;
case WebInputEvent::GestureFlingStart:
scroll_state_data.velocity_x = event.data.flingStart.velocityX;
@@ -531,8 +525,30 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::ScrollByMouseWheel(
blink::WebGestureDeviceTouchpad,
cc::MainThreadScrollingReason::kPageBasedScrolling);
return DID_NOT_HANDLE;
+
+ } else if (ShouldAnimate(wheel_event.hasPreciseScrollingDeltas)) {
+ base::TimeTicks event_time =
+ base::TimeTicks() +
+ base::TimeDelta::FromSecondsD(wheel_event.timeStampSeconds);
+ base::TimeDelta delay = base::TimeTicks::Now() - event_time;
+ cc::InputHandler::ScrollStatus scroll_status =
+ input_handler_->ScrollAnimated(gfx::Point(wheel_event.x, wheel_event.y),
+ scroll_delta, delay);
+
+ RecordMainThreadScrollingReasons(
+ blink::WebGestureDeviceTouchpad,
+ scroll_status.main_thread_scrolling_reasons);
+
+ switch (scroll_status.thread) {
+ case cc::InputHandler::SCROLL_ON_IMPL_THREAD:
+ return DID_HANDLE;
+ case cc::InputHandler::SCROLL_IGNORED:
+ return DROP_EVENT;
+ default:
+ return DID_NOT_HANDLE;
+ }
+
} else {
- DCHECK(!ShouldAnimate(wheel_event.hasPreciseScrollingDeltas));
cc::ScrollStateData scroll_state_begin_data;
scroll_state_begin_data.position_x = wheel_event.x;
scroll_state_begin_data.position_y = wheel_event.y;
@@ -667,7 +683,6 @@ InputHandlerProxy::HandleGestureScrollUpdate(
if (ShouldAnimate(gesture_event.data.scrollUpdate.deltaUnits !=
blink::WebGestureEvent::ScrollUnits::Pixels)) {
- DCHECK(!scroll_state.is_in_inertial_phase());
base::TimeTicks event_time =
base::TimeTicks() +
base::TimeDelta::FromSecondsD(gesture_event.timeStampSeconds);
« no previous file with comments | « content/browser/renderer_host/input/mouse_wheel_event_queue_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698