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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 2256733003: Touchpad scroll latching enabled for Mac behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittests fixed Created 4 years, 4 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return scroll_begin_event; 124 return scroll_begin_event;
125 } 125 }
126 126
127 cc::ScrollState CreateScrollStateForGesture(const WebGestureEvent& event) { 127 cc::ScrollState CreateScrollStateForGesture(const WebGestureEvent& event) {
128 cc::ScrollStateData scroll_state_data; 128 cc::ScrollStateData scroll_state_data;
129 switch (event.type) { 129 switch (event.type) {
130 case WebInputEvent::GestureScrollBegin: 130 case WebInputEvent::GestureScrollBegin:
131 scroll_state_data.position_x = event.x; 131 scroll_state_data.position_x = event.x;
132 scroll_state_data.position_y = event.y; 132 scroll_state_data.position_y = event.y;
133 scroll_state_data.is_beginning = true; 133 scroll_state_data.is_beginning = true;
134 // On Mac, a GestureScrollBegin in the inertial phase indicates a fling
135 // start.
136 if (event.data.scrollBegin.inertialPhase ==
137 WebGestureEvent::MomentumPhase)
tdresser 2016/08/18 16:55:54 Although this isn't technically required by the st
sahel 2016/08/18 17:37:59 Done.
138 scroll_state_data.is_in_inertial_phase = true;
134 break; 139 break;
135 case WebInputEvent::GestureFlingStart: 140 case WebInputEvent::GestureFlingStart:
136 scroll_state_data.velocity_x = event.data.flingStart.velocityX; 141 scroll_state_data.velocity_x = event.data.flingStart.velocityX;
137 scroll_state_data.velocity_y = event.data.flingStart.velocityY; 142 scroll_state_data.velocity_y = event.data.flingStart.velocityY;
138 scroll_state_data.is_in_inertial_phase = true; 143 scroll_state_data.is_in_inertial_phase = true;
139 break; 144 break;
140 case WebInputEvent::GestureScrollUpdate: 145 case WebInputEvent::GestureScrollUpdate:
141 scroll_state_data.delta_x = -event.data.scrollUpdate.deltaX; 146 scroll_state_data.delta_x = -event.data.scrollUpdate.deltaX;
142 scroll_state_data.delta_y = -event.data.scrollUpdate.deltaY; 147 scroll_state_data.delta_y = -event.data.scrollUpdate.deltaY;
143 scroll_state_data.velocity_x = event.data.scrollUpdate.velocityX; 148 scroll_state_data.velocity_x = event.data.scrollUpdate.velocityX;
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 // is made asynchronously, to minimize divergence between main thread and 1345 // is made asynchronously, to minimize divergence between main thread and
1341 // impl thread event handling paths. 1346 // impl thread event handling paths.
1342 base::ThreadTaskRunnerHandle::Get()->PostTask( 1347 base::ThreadTaskRunnerHandle::Get()->PostTask(
1343 FROM_HERE, 1348 FROM_HERE,
1344 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, 1349 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult,
1345 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1350 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1346 scroll_result)); 1351 scroll_result));
1347 } 1352 }
1348 1353
1349 } // namespace ui 1354 } // namespace ui
OLDNEW
« 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