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

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

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months 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 "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/vector2d_f.h" 11 #include "ui/gfx/geometry/vector2d_f.h"
11 12
12 namespace cc { 13 namespace cc {
13 14
14 class LayerTreeHostImpl; 15 class LayerTreeHostImpl;
15 16
16 // ScrollElasticityHelper is based on 17 // ScrollElasticityHelper is based on
17 // WebKit/Source/platform/mac/ScrollElasticityController.h 18 // WebKit/Source/platform/mac/ScrollElasticityController.h
18 /* 19 /*
19 * Copyright (C) 2011 Apple Inc. All rights reserved. 20 * Copyright (C) 2011 Apple Inc. All rights reserved.
(...skipping 25 matching lines...) Expand all
45 // interface itself. This artificial boundary is introduced to reduce the amount 46 // interface itself. This artificial boundary is introduced to reduce the amount
46 // of logic and state held directly inside LayerTreeHostImpl. 47 // of logic and state held directly inside LayerTreeHostImpl.
47 class CC_EXPORT ScrollElasticityHelper { 48 class CC_EXPORT ScrollElasticityHelper {
48 public: 49 public:
49 static ScrollElasticityHelper* CreateForLayerTreeHostImpl( 50 static ScrollElasticityHelper* CreateForLayerTreeHostImpl(
50 LayerTreeHostImpl* layer_tree_host_impl); 51 LayerTreeHostImpl* layer_tree_host_impl);
51 52
52 virtual ~ScrollElasticityHelper() {} 53 virtual ~ScrollElasticityHelper() {}
53 54
54 // 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.
55 virtual gfx::Vector2dF StretchAmount() = 0; 56 virtual gfx::Vector2dF StretchAmount() const = 0;
56 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0; 57 virtual void SetStretchAmount(const gfx::Vector2dF& stretch_amount) = 0;
57 // Returns true if either component of |direction| is pointing in a direction 58
58 // in which it is not possible to scroll any farther. It is only in this 59 // Functions for the scrolling of the root scroll layer.
59 // circumstance that an overscroll in that direction may begin. 60 virtual gfx::ScrollOffset ScrollOffset() const = 0;
60 // TODO(ccameron): Note that it is possible for a scroll to occur against a 61 virtual gfx::ScrollOffset MaxScrollOffset() const = 0;
61 // previous over-scroll. Such a scroll needs to first cancel out the 62 virtual void ScrollBy(const gfx::Vector2dF& delta) = 0;
62 // over-scroll, and only then may it start scrolling away from the edge. 63
63 virtual bool PinnedInDirection(const gfx::Vector2dF& direction) = 0;
64 // Whether or not the content of the page is scrollable in each direction.
65 virtual bool CanScrollHorizontally() = 0;
66 virtual bool CanScrollVertically() = 0;
67 // 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
68 // frame. 65 // frame.
69 virtual void RequestAnimate() = 0; 66 virtual void RequestAnimate() = 0;
70 }; 67 };
71 68
72 } // namespace cc 69 } // namespace cc
73 70
74 #endif // CC_INPUT_SCROLL_ELASTICITY_HELPER_H_ 71 #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