OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_TREES_TREE_SCROLL_ELASTICITY_CLIENT_H_ |
| 6 #define CC_TREES_TREE_SCROLL_ELASTICITY_CLIENT_H_ |
| 7 |
| 8 #include "cc/input/scroll_elasticity_controller.h" |
| 9 |
| 10 namespace cc { |
| 11 |
| 12 class LayerTreeHostImpl; |
| 13 |
| 14 class TreeScrollElasticityClient |
| 15 : public ScrollElasticityControllerClient { |
| 16 public: |
| 17 TreeScrollElasticityClient(LayerTreeHostImpl* tree); |
| 18 virtual ~TreeScrollElasticityClient(); |
| 19 |
| 20 ScrollElasticityController* controller() const { return controller_; } |
| 21 |
| 22 // cc::ScrollElasticityControllerClient implementation: |
| 23 void BindToController(ScrollElasticityController* controller) override; |
| 24 bool allowsHorizontalStretching() const override; |
| 25 bool allowsVerticalStretching() const override; |
| 26 gfx::Vector2dF stretchAmount() const override; |
| 27 bool pinnedInDirection(const gfx::Vector2dF& delta) const override; |
| 28 bool canScrollHorizontally() const override; |
| 29 bool canScrollVertically() const override; |
| 30 gfx::Vector2dF absoluteScrollPosition() const override; |
| 31 void immediateScrollBy(const gfx::Vector2dF& delta) override; |
| 32 void immediateScrollByWithoutContentEdgeConstraints(const gfx::Vector2dF& delt
a) override; |
| 33 void startSnapRubberbandTimer() override; |
| 34 void stopSnapRubberbandTimer() override; |
| 35 void adjustScrollPositionToBoundsIfNecessary() override; |
| 36 |
| 37 private: |
| 38 LayerTreeHostImpl* tree_; |
| 39 gfx::Vector2dF stretch_offset_; |
| 40 bool timer_active_; |
| 41 ScrollElasticityController* controller_; |
| 42 }; |
| 43 |
| 44 } // namespace cc |
| 45 |
| 46 #endif // CC_TREES_TREE_SCROLL_ELASTICITY_CLIENT_H_ |
OLD | NEW |