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

Side by Side Diff: content/browser/renderer_host/overscroll_controller.cc

Issue 12223110: aura: Populate and use the newly added acceleration ratio fields in wheel-events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/overscroll_controller.h" 5 #include "content/browser/renderer_host/overscroll_controller.h"
6 6
7 #include "content/browser/renderer_host/gesture_event_filter.h" 7 #include "content/browser/renderer_host/gesture_event_filter.h"
8 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 8 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/public/browser/overscroll_configuration.h" 10 #include "content/public/browser/overscroll_configuration.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 return !WebKit::WebInputEvent::isTouchEventType(event.type); 164 return !WebKit::WebInputEvent::isTouchEventType(event.type);
165 } 165 }
166 } 166 }
167 167
168 void OverscrollController::ProcessEventForOverscroll( 168 void OverscrollController::ProcessEventForOverscroll(
169 const WebKit::WebInputEvent& event) { 169 const WebKit::WebInputEvent& event) {
170 switch (event.type) { 170 switch (event.type) {
171 case WebKit::WebInputEvent::MouseWheel: { 171 case WebKit::WebInputEvent::MouseWheel: {
172 const WebKit::WebMouseWheelEvent& wheel = 172 const WebKit::WebMouseWheelEvent& wheel =
173 static_cast<const WebKit::WebMouseWheelEvent&>(event); 173 static_cast<const WebKit::WebMouseWheelEvent&>(event);
174 if (wheel.hasPreciseScrollingDeltas) 174 if (wheel.hasPreciseScrollingDeltas) {
175 ProcessOverscroll(wheel.deltaX, wheel.deltaY); 175 ProcessOverscroll(wheel.deltaX / wheel.accelerationRatioX,
rjkroege 2013/02/13 22:08:04 nit: inverse ratios (i.e. multiplies are cheaper)
176 wheel.deltaY / wheel.accelerationRatioY);
177 }
176 break; 178 break;
177 } 179 }
178 case WebKit::WebInputEvent::GestureScrollUpdate: { 180 case WebKit::WebInputEvent::GestureScrollUpdate: {
179 const WebKit::WebGestureEvent& gesture = 181 const WebKit::WebGestureEvent& gesture =
180 static_cast<const WebKit::WebGestureEvent&>(event); 182 static_cast<const WebKit::WebGestureEvent&>(event);
181 ProcessOverscroll(gesture.data.scrollUpdate.deltaX, 183 ProcessOverscroll(gesture.data.scrollUpdate.deltaX,
182 gesture.data.scrollUpdate.deltaY); 184 gesture.data.scrollUpdate.deltaY);
183 break; 185 break;
184 } 186 }
185 case WebKit::WebInputEvent::GestureFlingStart: { 187 case WebKit::WebInputEvent::GestureFlingStart: {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 const WebKit::WebInputEvent& event) const { 287 const WebKit::WebInputEvent& event) const {
286 if (!WebKit::WebInputEvent::isGestureEventType(event.type)) 288 if (!WebKit::WebInputEvent::isGestureEventType(event.type))
287 return false; 289 return false;
288 290
289 // If the GestureEventFilter already processed this event, then the event must 291 // If the GestureEventFilter already processed this event, then the event must
290 // not be sent to the filter again. 292 // not be sent to the filter again.
291 return !render_widget_host_->gesture_event_filter()->HasQueuedGestureEvents(); 293 return !render_widget_host_->gesture_event_filter()->HasQueuedGestureEvents();
292 } 294 }
293 295
294 } // namespace content 296 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698