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

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

Issue 2158423002: Wheel scroll latching enabled behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit_tests_fixed Created 4 years, 5 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 "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 // In Mac flings are also scrolls.
135 if (event.data.scrollBegin.inertialPhase ==
136 WebGestureEvent::MomentumPhase)
137 scroll_state_data.is_in_inertial_phase = true;
134 break; 138 break;
135 case WebInputEvent::GestureFlingStart: 139 case WebInputEvent::GestureFlingStart:
136 scroll_state_data.velocity_x = event.data.flingStart.velocityX; 140 scroll_state_data.velocity_x = event.data.flingStart.velocityX;
137 scroll_state_data.velocity_y = event.data.flingStart.velocityY; 141 scroll_state_data.velocity_y = event.data.flingStart.velocityY;
138 scroll_state_data.is_in_inertial_phase = true; 142 scroll_state_data.is_in_inertial_phase = true;
139 break; 143 break;
140 case WebInputEvent::GestureScrollUpdate: 144 case WebInputEvent::GestureScrollUpdate:
141 scroll_state_data.delta_x = -event.data.scrollUpdate.deltaX; 145 scroll_state_data.delta_x = -event.data.scrollUpdate.deltaX;
142 scroll_state_data.delta_y = -event.data.scrollUpdate.deltaY; 146 scroll_state_data.delta_y = -event.data.scrollUpdate.deltaY;
143 scroll_state_data.velocity_x = event.data.scrollUpdate.velocityX; 147 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 1344 // is made asynchronously, to minimize divergence between main thread and
1341 // impl thread event handling paths. 1345 // impl thread event handling paths.
1342 base::ThreadTaskRunnerHandle::Get()->PostTask( 1346 base::ThreadTaskRunnerHandle::Get()->PostTask(
1343 FROM_HERE, 1347 FROM_HERE,
1344 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, 1348 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult,
1345 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1349 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1346 scroll_result)); 1350 scroll_result));
1347 } 1351 }
1348 1352
1349 } // namespace ui 1353 } // namespace ui
OLDNEW
« content/public/common/content_features.cc ('K') | « content/public/common/content_features.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698