| 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 | |
| 57 // The amount that the view is stretched past the normal allowable bounds. | 55 // The amount that the view is stretched past the normal allowable bounds. |
| 58 virtual gfx::Vector2dF StretchAmount() const = 0; | 56 virtual gfx::Vector2dF StretchAmount() const = 0; |
| 59 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0; | 57 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0; |
| 60 | 58 |
| 61 // Functions for the scrolling of the root scroll layer. | 59 // Functions for the scrolling of the root scroll layer. |
| 62 virtual gfx::ScrollOffset ScrollOffset() const = 0; | 60 virtual gfx::ScrollOffset ScrollOffset() const = 0; |
| 63 virtual gfx::ScrollOffset MaxScrollOffset() const = 0; | 61 virtual gfx::ScrollOffset MaxScrollOffset() const = 0; |
| 64 virtual void ScrollBy(const gfx::Vector2dF& delta) = 0; | 62 virtual void ScrollBy(const gfx::Vector2dF& delta) = 0; |
| 65 | 63 |
| 66 // Request that the controller have its Animate method called for the next | 64 // Request that the controller have its Animate method called for the next |
| 67 // frame. | 65 // frame. |
| 68 virtual void RequestAnimate() = 0; | 66 virtual void RequestAnimate() = 0; |
| 69 }; | 67 }; |
| 70 | 68 |
| 71 } // namespace cc | 69 } // namespace cc |
| 72 | 70 |
| 73 #endif // CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ | 71 #endif // CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ |
| OLD | NEW |