Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: cc/input/scroll_elasticity_helper.h

Issue 2194833002: Overscroll and Elasticity for views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-RouteThroughInputHandler
Patch Set: Restore functionality and fix bugs \o/ Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/input/input_handler.h ('k') | cc/input/scroll_elasticity_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory>
9
10 #include "base/memory/weak_ptr.h"
8 #include "base/time/time.h" 11 #include "base/time/time.h"
9 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
10 #include "ui/gfx/geometry/scroll_offset.h" 13 #include "ui/gfx/geometry/scroll_offset.h"
11 #include "ui/gfx/geometry/vector2d_f.h" 14 #include "ui/gfx/geometry/vector2d_f.h"
12 15
13 namespace cc { 16 namespace cc {
14 17
15 class LayerTreeHostImpl; 18 class LayerTreeHostImpl;
16 19
17 // ScrollElasticityHelper is based on 20 // ScrollElasticityHelper is based on
(...skipping 22 matching lines...) Expand all
40 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 43 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
41 * THE POSSIBILITY OF SUCH DAMAGE. 44 * THE POSSIBILITY OF SUCH DAMAGE.
42 */ 45 */
43 46
44 // Interface between a LayerTreeHostImpl and the ScrollElasticityController. It 47 // Interface between a LayerTreeHostImpl and the ScrollElasticityController. It
45 // would be possible, in principle, for LayerTreeHostImpl to implement this 48 // would be possible, in principle, for LayerTreeHostImpl to implement this
46 // interface itself. This artificial boundary is introduced to reduce the amount 49 // interface itself. This artificial boundary is introduced to reduce the amount
47 // of logic and state held directly inside LayerTreeHostImpl. 50 // of logic and state held directly inside LayerTreeHostImpl.
48 class CC_EXPORT ScrollElasticityHelper { 51 class CC_EXPORT ScrollElasticityHelper {
49 public: 52 public:
53 static std::unique_ptr<ScrollElasticityHelper> CreateForLayer(
54 int layer_scroll_layer_id,
55 LayerTreeHostImpl* layer_tree_host_impl);
50 static ScrollElasticityHelper* CreateForLayerTreeHostImpl( 56 static ScrollElasticityHelper* CreateForLayerTreeHostImpl(
51 LayerTreeHostImpl* layer_tree_host_impl); 57 LayerTreeHostImpl* layer_tree_host_impl);
52 58
53 virtual ~ScrollElasticityHelper() {} 59 virtual ~ScrollElasticityHelper() {}
54 60
55 virtual bool IsUserScrollable() const = 0; 61 virtual bool IsUserScrollable() const = 0;
56 62
57 // The amount that the view is stretched past the normal allowable bounds. 63 // The amount that the view is stretched past the normal allowable bounds.
58 virtual gfx::Vector2dF StretchAmount() const = 0; 64 virtual gfx::Vector2dF StretchAmount() const = 0;
59 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0; 65 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0;
60 66
61 // Functions for the scrolling of the root scroll layer. 67 // Functions for the scrolling of the root scroll layer.
62 virtual gfx::ScrollOffset ScrollOffset() const = 0; 68 virtual gfx::ScrollOffset ScrollOffset() const = 0;
63 virtual gfx::ScrollOffset MaxScrollOffset() const = 0; 69 virtual gfx::ScrollOffset MaxScrollOffset() const = 0;
64 virtual void ScrollBy(const gfx::Vector2dF& delta) = 0; 70 virtual void ScrollBy(const gfx::Vector2dF& delta) = 0;
65 71
72 virtual base::WeakPtr<ScrollElasticityHelper> GetWeakPtr() = 0;
73
66 // Requests that another frame happens for the controller to continue ticking 74 // Requests that another frame happens for the controller to continue ticking
67 // animations. 75 // animations.
68 virtual void RequestOneBeginFrame() = 0; 76 virtual void RequestOneBeginFrame() = 0;
69 }; 77 };
70 78
71 } // namespace cc 79 } // namespace cc
72 80
73 #endif // CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ 81 #endif // CC_INPUT_SCROLL_ELASTICITY_HELPER_H_
OLDNEW
« no previous file with comments | « cc/input/input_handler.h ('k') | cc/input/scroll_elasticity_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698