Add fling velocity updates from gesture curves.
As per crrev.com/13674008, WebGestureCurveTarget now supports fling velocity
notifications. This patch hooks in the notifications from existing
WebGestureCurve implementations.
BUG=135975
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/14128010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197139 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/input/input_handler.h b/cc/input/input_handler.h
index 0d943df..982befa 100644
--- a/cc/input/input_handler.h
+++ b/cc/input/input_handler.h
@@ -56,6 +56,8 @@
// ScrollIgnored if not.
virtual ScrollStatus FlingScrollBegin() = 0;
+ virtual void NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) = 0;
+
// Stop scrolling the selected layer. Should only be called if ScrollBegin()
// returned ScrollStarted.
virtual void ScrollEnd() = 0;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 69ecc85..e559c81 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1745,6 +1745,7 @@
void LayerTreeHostImpl::ClearCurrentlyScrollingLayer() {
active_tree_->ClearCurrentlyScrollingLayer();
did_lock_scrolling_layer_ = false;
+ current_fling_velocity_ = gfx::Vector2dF();
}
void LayerTreeHostImpl::ScrollEnd() {
@@ -1762,6 +1763,10 @@
return ScrollIgnored;
}
+void LayerTreeHostImpl::NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) {
+ current_fling_velocity_ = velocity;
+}
+
void LayerTreeHostImpl::PinchGestureBegin() {
pinch_gesture_active_ = true;
previous_pinch_anchor_ = gfx::Point();
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h
index ed599b0..fc1e0e9 100644
--- a/cc/trees/layer_tree_host_impl.h
+++ b/cc/trees/layer_tree_host_impl.h
@@ -105,6 +105,7 @@
WebKit::WebScrollbar::ScrollDirection direction) OVERRIDE;
virtual void ScrollEnd() OVERRIDE;
virtual InputHandler::ScrollStatus FlingScrollBegin() OVERRIDE;
+ virtual void NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) OVERRIDE;
virtual void PinchGestureBegin() OVERRIDE;
virtual void PinchGestureUpdate(float magnify_delta,
gfx::Point anchor) OVERRIDE;
@@ -438,6 +439,8 @@
bool visible_;
ManagedMemoryPolicy managed_memory_policy_;
+ gfx::Vector2dF current_fling_velocity_;
+
bool pinch_gesture_active_;
gfx::Point previous_pinch_anchor_;