Index: cc/input/input_handler.h |
diff --git a/cc/input/input_handler.h b/cc/input/input_handler.h |
index b3205a8a6485bbe9839c7d621beb39ae15c83d31..7b83e4b2fd8d5fc61d3ea26b7175078ae7c23f9f 100644 |
--- a/cc/input/input_handler.h |
+++ b/cc/input/input_handler.h |
@@ -6,6 +6,7 @@ |
#define CC_INPUT_INPUT_HANDLER_H_ |
#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/time/time.h" |
#include "cc/base/cc_export.h" |
#include "cc/base/swap_promise_monitor.h" |
@@ -23,6 +24,22 @@ namespace ui { struct LatencyInfo; } |
namespace cc { |
class LayerScrollOffsetDelegate; |
+class ScrollElasticityHelper; |
+ |
+struct CC_EXPORT InputHandlerScrollResult { |
+ InputHandlerScrollResult(); |
+ // Did any layer scroll as a result this ScrollBy call? |
+ bool did_scroll; |
+ // Was any of the scroll delta argument to this ScrollBy call not used? |
+ bool did_overscroll_root; |
+ // The total overscroll that has been accumulated by all ScrollBy calls that |
+ // have had overscroll since the last ScrollBegin call. This resets upon a |
+ // ScrollBy with no overscroll. |
+ gfx::Vector2dF accumulated_root_overscroll; |
+ // The amount of the scroll delta argument to this ScrollBy call that was not |
+ // used for scrolling. |
+ gfx::Vector2dF unused_scroll_delta; |
+}; |
class CC_EXPORT InputHandlerClient { |
public: |
@@ -32,13 +49,6 @@ class CC_EXPORT InputHandlerClient { |
virtual void Animate(base::TimeTicks time) = 0; |
virtual void MainThreadHasStoppedFlinging() = 0; |
- // Called when scroll deltas reaching the root scrolling layer go unused. |
- // The accumulated overscroll is scoped by the most recent call to |
- // InputHandler::ScrollBegin. |
- virtual void DidOverscroll(const gfx::PointF& causal_event_viewport_point, |
- const gfx::Vector2dF& accumulated_overscroll, |
- const gfx::Vector2dF& latest_overscroll_delta) = 0; |
- |
protected: |
InputHandlerClient() {} |
@@ -85,15 +95,16 @@ class CC_EXPORT InputHandler { |
// should be in viewport (logical pixel) coordinates. Otherwise they are in |
// scrolling layer's (logical pixel) space. If there is no room to move the |
// layer in the requested direction, its first ancestor layer that can be |
- // scrolled will be moved instead. If no layer can be moved in the requested |
- // direction at all, then false is returned. If any layer is moved, then |
- // true is returned. |
+ // scrolled will be moved instead. The return value's |did_scroll| field is |
+ // set to false if no layer can be moved in the requested direction at all, |
+ // and set to true if any layer is moved. |
// If the scroll delta hits the root layer, and the layer can no longer move, |
// the root overscroll accumulated within this ScrollBegin() scope is reported |
- // to the client. |
+ // in the return value's |accumulated_overscroll| field. |
// Should only be called if ScrollBegin() returned ScrollStarted. |
- virtual bool ScrollBy(const gfx::Point& viewport_point, |
- const gfx::Vector2dF& scroll_delta) = 0; |
+ virtual InputHandlerScrollResult ScrollBy( |
+ const gfx::Point& viewport_point, |
+ const gfx::Vector2dF& scroll_delta) = 0; |
virtual bool ScrollVerticallyByPage(const gfx::Point& viewport_point, |
ScrollDirection direction) = 0; |
@@ -140,6 +151,8 @@ class CC_EXPORT InputHandler { |
virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
ui::LatencyInfo* latency) = 0; |
+ virtual ScrollElasticityHelper* CreateScrollElasticityHelper() = 0; |
+ |
protected: |
InputHandler() {} |
virtual ~InputHandler() {} |