| Index: cc/layers/viewport.h
|
| diff --git a/cc/layers/viewport.h b/cc/layers/viewport.h
|
| index 5052b5e2499e1480050257b299282cfb96f092df..0c928818ac6a0aff0e4a82bc9096054fb277c9bc 100644
|
| --- a/cc/layers/viewport.h
|
| +++ b/cc/layers/viewport.h
|
| @@ -5,6 +5,7 @@
|
| #ifndef CC_LAYERS_VIEWPORT_H_
|
| #define CC_LAYERS_VIEWPORT_H_
|
|
|
| +#include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "cc/layers/layer_impl.h"
|
| @@ -46,12 +47,19 @@ class CC_EXPORT Viewport {
|
| bool is_wheel_scroll,
|
| bool affect_top_controls);
|
|
|
| + // Scrolls the viewport, bubbling the delta between the inner and outer
|
| + // viewport. Only animates either of the two viewports.
|
| + gfx::Vector2dF ScrollAnimated(const gfx::Vector2dF& delta);
|
| +
|
| void PinchUpdate(float magnify_delta, const gfx::Point& anchor);
|
| void PinchEnd();
|
|
|
| private:
|
| explicit Viewport(LayerTreeHostImpl* host_impl);
|
|
|
| + // Returns true if viewport_delta is stricly less than pending_delta.
|
| + static bool ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta,
|
| + const gfx::Vector2dF& pending_delta);
|
| bool ShouldTopControlsConsumeScroll(const gfx::Vector2dF& scroll_delta) const;
|
| gfx::Vector2dF AdjustOverscroll(const gfx::Vector2dF& delta) const;
|
|
|
| @@ -74,6 +82,8 @@ class CC_EXPORT Viewport {
|
| // is used to "snap" a pinch-zoom to the edge of the screen.
|
| gfx::Vector2d pinch_anchor_adjustment_;
|
|
|
| + FRIEND_TEST_ALL_PREFIXES(ViewportTest, ShouldAnimateViewport);
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(Viewport);
|
| };
|
|
|
|
|