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

Unified Diff: ui/events/gesture_detection/gesture_provider.cc

Issue 1049383003: Postpone rail application for touch scrolling - chrome side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: ui/events/gesture_detection/gesture_provider.cc
diff --git a/ui/events/gesture_detection/gesture_provider.cc b/ui/events/gesture_detection/gesture_provider.cc
index 0d3a55f6b5aa229c0161bc0163cbc712f3e40668..1289e428f82cfe3da62ee6e43d332d6339d4a6e2 100644
--- a/ui/events/gesture_detection/gesture_provider.cc
+++ b/ui/events/gesture_detection/gesture_provider.cc
@@ -9,6 +9,7 @@
#include "base/auto_reset.h"
#include "base/trace_event/trace_event.h"
#include "ui/events/event_constants.h"
+#include "ui/events/gesture_detection/gesture_detection_switches.h"
#include "ui/events/gesture_detection/gesture_event_data.h"
#include "ui/events/gesture_detection/gesture_listeners.h"
#include "ui/events/gesture_detection/motion_event.h"
@@ -318,7 +319,9 @@ class GestureProvider::GestureListenerImpl : public ScaleGestureListener,
}
snap_scroll_controller_.UpdateSnapScrollMode(distance_x, distance_y);
- if (snap_scroll_controller_.IsSnappingScrolls()) {
+
+ if (!PostponeRailApplication() &&
jdduke (slow) 2015/04/01 17:40:49 We've worked hard to keep globals out of the gestu
+ snap_scroll_controller_.IsSnappingScrolls()) {
if (snap_scroll_controller_.IsSnapHorizontal())
distance_y = 0;
else
@@ -327,7 +330,9 @@ class GestureProvider::GestureListenerImpl : public ScaleGestureListener,
if (distance_x || distance_y) {
GestureEventDetails scroll_details(
- ET_GESTURE_SCROLL_UPDATE, -distance_x, -distance_y);
+ ET_GESTURE_SCROLL_UPDATE, -distance_x, -distance_y,
+ snap_scroll_controller_.ScrollRailState());
+
const gfx::RectF bounding_box = GetBoundingBox(e2, scroll_details.type());
const gfx::PointF center = bounding_box.CenterPoint();
const gfx::PointF raw_center =
@@ -352,14 +357,6 @@ class GestureProvider::GestureListenerImpl : public ScaleGestureListener,
const MotionEvent& e2,
float velocity_x,
float velocity_y) override {
- if (snap_scroll_controller_.IsSnappingScrolls()) {
- if (snap_scroll_controller_.IsSnapHorizontal()) {
- velocity_y = 0;
- } else {
- velocity_x = 0;
- }
- }
-
if (!velocity_x && !velocity_y)
return true;
@@ -372,8 +369,17 @@ class GestureProvider::GestureListenerImpl : public ScaleGestureListener,
Send(CreateGesture(scroll_details, e2));
}
+ if (!PostponeRailApplication() &&
+ snap_scroll_controller_.IsSnappingScrolls()) {
+ if (snap_scroll_controller_.IsSnapHorizontal())
+ velocity_y = 0;
+ else
+ velocity_x = 0;
+ }
+
GestureEventDetails fling_details(
- ET_SCROLL_FLING_START, velocity_x, velocity_y);
+ ET_SCROLL_FLING_START, velocity_x, velocity_y,
+ snap_scroll_controller_.ScrollRailState());
Send(CreateGesture(fling_details, e2));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698