OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ | 5 #ifndef CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ |
6 #define CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ | 6 #define CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "ui/gfx/geometry/scroll_offset.h" | 10 #include "ui/gfx/geometry/scroll_offset.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // would be possible, in principle, for LayerTreeHostImpl to implement this | 45 // would be possible, in principle, for LayerTreeHostImpl to implement this |
46 // interface itself. This artificial boundary is introduced to reduce the amount | 46 // interface itself. This artificial boundary is introduced to reduce the amount |
47 // of logic and state held directly inside LayerTreeHostImpl. | 47 // of logic and state held directly inside LayerTreeHostImpl. |
48 class CC_EXPORT ScrollElasticityHelper { | 48 class CC_EXPORT ScrollElasticityHelper { |
49 public: | 49 public: |
50 static ScrollElasticityHelper* CreateForLayerTreeHostImpl( | 50 static ScrollElasticityHelper* CreateForLayerTreeHostImpl( |
51 LayerTreeHostImpl* layer_tree_host_impl); | 51 LayerTreeHostImpl* layer_tree_host_impl); |
52 | 52 |
53 virtual ~ScrollElasticityHelper() {} | 53 virtual ~ScrollElasticityHelper() {} |
54 | 54 |
| 55 virtual bool IsUserScrollable() const = 0; |
| 56 |
55 // The amount that the view is stretched past the normal allowable bounds. | 57 // The amount that the view is stretched past the normal allowable bounds. |
56 virtual gfx::Vector2dF StretchAmount() const = 0; | 58 virtual gfx::Vector2dF StretchAmount() const = 0; |
57 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0; | 59 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0; |
58 | 60 |
59 // Functions for the scrolling of the root scroll layer. | 61 // Functions for the scrolling of the root scroll layer. |
60 virtual gfx::ScrollOffset ScrollOffset() const = 0; | 62 virtual gfx::ScrollOffset ScrollOffset() const = 0; |
61 virtual gfx::ScrollOffset MaxScrollOffset() const = 0; | 63 virtual gfx::ScrollOffset MaxScrollOffset() const = 0; |
62 virtual void ScrollBy(const gfx::Vector2dF& delta) = 0; | 64 virtual void ScrollBy(const gfx::Vector2dF& delta) = 0; |
63 | 65 |
64 // Request that the controller have its Animate method called for the next | 66 // Request that the controller have its Animate method called for the next |
65 // frame. | 67 // frame. |
66 virtual void RequestAnimate() = 0; | 68 virtual void RequestAnimate() = 0; |
67 }; | 69 }; |
68 | 70 |
69 } // namespace cc | 71 } // namespace cc |
70 | 72 |
71 #endif // CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ | 73 #endif // CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ |
OLD | NEW |