Chromium Code Reviews| Index: cc/layers/viewport.h |
| diff --git a/cc/layers/viewport.h b/cc/layers/viewport.h |
| index 5052b5e2499e1480050257b299282cfb96f092df..6e13e9e948d6df95f631b8f852ce2fc8426c57d7 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 pendinf_delta. |
|
bokan
2016/04/06 13:35:52
Nit: s/pendinf_delta/pending_delta
ymalik
2016/04/06 15:33:45
Done.
|
| + 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); |
| }; |