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

Unified Diff: content/renderer/input/input_handler_proxy.cc

Issue 304793003: use enum to specify deviceSource for fling animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased for parallel breaking changes Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/input/input_handler_proxy.cc
diff --git a/content/renderer/input/input_handler_proxy.cc b/content/renderer/input/input_handler_proxy.cc
index e1d6dd34ab31259d8ed0e9d5e345007106005c38..bf38693024e56d1c3163e7eff7b04ab0573c7a82 100644
--- a/content/renderer/input/input_handler_proxy.cc
+++ b/content/renderer/input/input_handler_proxy.cc
@@ -359,7 +359,7 @@ InputHandlerProxy::HandleGestureFling(
const WebGestureEvent& gesture_event) {
cc::InputHandler::ScrollStatus scroll_status;
- if (gesture_event.sourceDevice == WebGestureEvent::Touchpad) {
+ if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) {
scroll_status = input_handler_->ScrollBegin(
gfx::Point(gesture_event.x, gesture_event.y),
cc::InputHandler::NonBubblingGesture);
@@ -376,14 +376,18 @@ InputHandlerProxy::HandleGestureFling(
switch (scroll_status) {
case cc::InputHandler::ScrollStarted: {
- if (gesture_event.sourceDevice == WebGestureEvent::Touchpad)
+ if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad)
input_handler_->ScrollEnd();
const float vx = gesture_event.data.flingStart.velocityX;
const float vy = gesture_event.data.flingStart.velocityY;
current_fling_velocity_ = gfx::Vector2dF(vx, vy);
+ // TODO(rjkroege): Remove cast after landing 3rd patch for
+ // http://crbug.com/343327
fling_curve_.reset(client_->CreateFlingAnimationCurve(
- gesture_event.sourceDevice, WebFloatPoint(vx, vy), blink::WebSize()));
+ (blink::WebGestureDevice)gesture_event.sourceDevice,
+ WebFloatPoint(vx, vy),
+ blink::WebSize()));
disallow_horizontal_fling_scroll_ = !vx;
disallow_vertical_fling_scroll_ = !vy;
TRACE_EVENT_ASYNC_BEGIN2("input",
@@ -420,7 +424,7 @@ InputHandlerProxy::HandleGestureFling(
"input",
"InputHandlerProxy::HandleGestureFling::ignored",
TRACE_EVENT_SCOPE_THREAD);
- if (gesture_event.sourceDevice == WebGestureEvent::Touchpad) {
+ if (gesture_event.sourceDevice == blink::WebGestureDeviceTouchpad) {
// We still pass the curve to the main thread if there's nothing
// scrollable, in case something
// registers a handler before the curve is over.
@@ -478,7 +482,7 @@ bool InputHandlerProxy::FilterInputEventForFlingBoosting(
case WebInputEvent::GestureScrollBegin:
if (!input_handler_->IsCurrentlyScrollingLayerAt(
gfx::Point(gesture_event.x, gesture_event.y),
- fling_parameters_.sourceDevice == WebGestureEvent::Touchpad
+ fling_parameters_.sourceDevice == blink::WebGestureDeviceTouchpad
? cc::InputHandler::NonBubblingGesture
: cc::InputHandler::Gesture)) {
CancelCurrentFling(true);
@@ -528,8 +532,11 @@ bool InputHandlerProxy::FilterInputEventForFlingBoosting(
current_fling_velocity_.y());
deferred_fling_cancel_time_seconds_ = 0;
last_fling_boost_event_ = WebGestureEvent();
+ // TODO(rjkroege): Remove cast after 3rd patch of http://crbug.com/343327
fling_curve_.reset(client_->CreateFlingAnimationCurve(
- gesture_event.sourceDevice, velocity, blink::WebSize()));
+ (blink::WebGestureDevice)gesture_event.sourceDevice,
+ velocity,
+ blink::WebSize()));
fling_parameters_.startTime = gesture_event.timeStampSeconds;
fling_parameters_.delta = velocity;
fling_parameters_.point = WebPoint(gesture_event.x, gesture_event.y);
@@ -668,7 +675,7 @@ bool InputHandlerProxy::CancelCurrentFling(
bool send_fling_stopped_notification) {
bool had_fling_animation = fling_curve_;
if (had_fling_animation &&
- fling_parameters_.sourceDevice == WebGestureEvent::Touchscreen) {
+ fling_parameters_.sourceDevice == blink::WebGestureDeviceTouchscreen) {
input_handler_->ScrollEnd();
TRACE_EVENT_ASYNC_END0(
"input",
@@ -762,10 +769,10 @@ bool InputHandlerProxy::scrollBy(const WebFloatSize& increment,
bool did_scroll = false;
switch (fling_parameters_.sourceDevice) {
- case WebGestureEvent::Touchpad:
+ case blink::WebGestureDeviceTouchpad:
did_scroll = TouchpadFlingScroll(clipped_increment);
break;
- case WebGestureEvent::Touchscreen:
+ case blink::WebGestureDeviceTouchscreen:
clipped_increment = ToClientScrollIncrement(clipped_increment);
did_scroll = input_handler_->ScrollBy(fling_parameters_.point,
clipped_increment);
« no previous file with comments | « content/common/input/synthetic_web_input_event_builders.cc ('k') | content/renderer/input/input_handler_proxy_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698