[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 1 | // Copyright 2011 The Chromium Authors. All rights reserved. |
[email protected] | 0fb2500 | 2012-10-12 07:20:02 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 4 | |
[email protected] | 3052b10f | 2013-03-18 07:41:21 | [diff] [blame] | 5 | #ifndef CC_INPUT_INPUT_HANDLER_H_ |
| 6 | #define CC_INPUT_INPUT_HANDLER_H_ |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 7 | |
danakj | 60bc3bc | 2016-04-09 00:24:48 | [diff] [blame] | 8 | #include <memory> |
| 9 | |
[email protected] | 1b0df50 | 2013-06-27 23:39:58 | [diff] [blame] | 10 | #include "base/time/time.h" |
chrishtr | ac41ff9 | 2017-03-17 05:07:30 | [diff] [blame] | 11 | #include "cc/cc_export.h" |
dtapuska | f206a40d | 2016-02-05 21:36:02 | [diff] [blame] | 12 | #include "cc/input/event_listener_properties.h" |
danakj | 3590476 | 2016-01-21 20:49:40 | [diff] [blame] | 13 | #include "cc/input/main_thread_scrolling_reason.h" |
Sandra Sun | 2288e853 | 2017-11-30 22:50:16 | [diff] [blame] | 14 | #include "cc/input/overscroll_behavior.h" |
majidvp | 944a8cd | 2016-01-12 21:05:18 | [diff] [blame] | 15 | #include "cc/input/scroll_state.h" |
[email protected] | c28df4c1 | 2013-05-22 17:36:49 | [diff] [blame] | 16 | #include "cc/input/scrollbar.h" |
Hayley Ferr | 2b14e2a6c | 2017-07-04 17:34:43 | [diff] [blame] | 17 | #include "cc/input/touch_action.h" |
Robert Flack | b62bd42 | 2018-07-25 14:54:42 | [diff] [blame] | 18 | #include "cc/trees/element_id.h" |
jamesr | f313a21 | 2015-03-16 21:27:37 | [diff] [blame] | 19 | #include "cc/trees/swap_promise_monitor.h" |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 20 | |
[email protected] | d455d55 | 2012-11-02 00:19:06 | [diff] [blame] | 21 | namespace gfx { |
| 22 | class Point; |
danakj | 0481b57 | 2015-09-10 01:18:01 | [diff] [blame] | 23 | class ScrollOffset; |
danakj | ddaec91 | 2015-09-25 19:38:40 | [diff] [blame] | 24 | class SizeF; |
[email protected] | 240376c | 2013-03-07 04:12:34 | [diff] [blame] | 25 | class Vector2dF; |
[email protected] | d455d55 | 2012-11-02 00:19:06 | [diff] [blame] | 26 | } |
| 27 | |
miletus | 45effdc4 | 2015-08-05 00:29:18 | [diff] [blame] | 28 | namespace ui { |
| 29 | class LatencyInfo; |
| 30 | } |
[email protected] | b76329d | 2013-06-11 04:15:08 | [diff] [blame] | 31 | |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 32 | namespace cc { |
| 33 | |
ccameron | 4163cc35 | 2014-11-13 19:06:36 | [diff] [blame] | 34 | class ScrollElasticityHelper; |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 35 | |
ccameron | 36d091f | 2014-11-07 03:18:50 | [diff] [blame] | 36 | struct CC_EXPORT InputHandlerScrollResult { |
| 37 | InputHandlerScrollResult(); |
| 38 | // Did any layer scroll as a result this ScrollBy call? |
| 39 | bool did_scroll; |
| 40 | // Was any of the scroll delta argument to this ScrollBy call not used? |
| 41 | bool did_overscroll_root; |
| 42 | // The total overscroll that has been accumulated by all ScrollBy calls that |
| 43 | // have had overscroll since the last ScrollBegin call. This resets upon a |
| 44 | // ScrollBy with no overscroll. |
| 45 | gfx::Vector2dF accumulated_root_overscroll; |
| 46 | // The amount of the scroll delta argument to this ScrollBy call that was not |
| 47 | // used for scrolling. |
| 48 | gfx::Vector2dF unused_scroll_delta; |
sunyunjia | bbea8a9 | 2017-08-31 11:18:54 | [diff] [blame] | 49 | // How the browser should handle the overscroll navigation based on the css |
| 50 | // property scroll-boundary-behavior. |
Sandra Sun | 2288e853 | 2017-11-30 22:50:16 | [diff] [blame] | 51 | OverscrollBehavior overscroll_behavior; |
Sandra Sun | 6141310 | 2018-04-09 22:24:43 | [diff] [blame] | 52 | // The current offset of the currently scrolling node. It is in DIP or |
Sandra Sun | 5b21b4e | 2018-05-17 23:28:36 | [diff] [blame] | 53 | // physical pixels depending on the use-zoom-for-dsf flag. If the currently |
| 54 | // scrolling node is the viewport, this would be the sum of the scroll offsets |
| 55 | // of the inner and outer node, representing the visual scroll offset. |
| 56 | gfx::Vector2dF current_visual_offset; |
ccameron | 36d091f | 2014-11-07 03:18:50 | [diff] [blame] | 57 | }; |
| 58 | |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 59 | class CC_EXPORT InputHandlerClient { |
| 60 | public: |
Vladimir Levin | f06d1cd7 | 2019-03-13 18:24:10 | [diff] [blame^] | 61 | InputHandlerClient(const InputHandlerClient&) = delete; |
| 62 | virtual ~InputHandlerClient() = default; |
| 63 | |
| 64 | InputHandlerClient& operator=(const InputHandlerClient&) = delete; |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 65 | |
| 66 | virtual void WillShutdown() = 0; |
| 67 | virtual void Animate(base::TimeTicks time) = 0; |
ccameron | a8a42b2 | 2014-12-23 03:24:08 | [diff] [blame] | 68 | virtual void ReconcileElasticOverscrollAndRootScroll() = 0; |
danakj | dd74e51 | 2015-09-21 23:07:59 | [diff] [blame] | 69 | virtual void UpdateRootLayerStateForSynchronousInputHandler( |
| 70 | const gfx::ScrollOffset& total_scroll_offset, |
| 71 | const gfx::ScrollOffset& max_scroll_offset, |
| 72 | const gfx::SizeF& scrollable_size, |
| 73 | float page_scale_factor, |
| 74 | float min_page_scale_factor, |
| 75 | float max_page_scale_factor) = 0; |
chongz | 679c4fb | 2016-11-18 20:04:40 | [diff] [blame] | 76 | virtual void DeliverInputForBeginFrame() = 0; |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 77 | |
| 78 | protected: |
Vladimir Levin | f06d1cd7 | 2019-03-13 18:24:10 | [diff] [blame^] | 79 | InputHandlerClient() = default; |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 80 | }; |
| 81 | |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 82 | // The InputHandler is a way for the embedders to interact with the impl thread |
| 83 | // side of the compositor implementation. There is one InputHandler per |
| 84 | // LayerTreeHost. To use the input handler, implement the InputHanderClient |
| 85 | // interface and bind it to the handler on the compositor thread. |
| 86 | class CC_EXPORT InputHandler { |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 87 | public: |
[email protected] | 05ba53c | 2014-04-16 21:22:51 | [diff] [blame] | 88 | // Note these are used in a histogram. Do not reorder or delete existing |
| 89 | // entries. |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 90 | enum ScrollThread { |
ericrk | 7c03099 | 2015-02-20 01:39:38 | [diff] [blame] | 91 | SCROLL_ON_MAIN_THREAD = 0, |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 92 | SCROLL_ON_IMPL_THREAD, |
ericrk | 7c03099 | 2015-02-20 01:39:38 | [diff] [blame] | 93 | SCROLL_IGNORED, |
| 94 | SCROLL_UNKNOWN, |
danakj | 3590476 | 2016-01-21 20:49:40 | [diff] [blame] | 95 | LAST_SCROLL_STATUS = SCROLL_UNKNOWN |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 96 | }; |
| 97 | |
Vladimir Levin | f06d1cd7 | 2019-03-13 18:24:10 | [diff] [blame^] | 98 | InputHandler(const InputHandler&) = delete; |
| 99 | InputHandler& operator=(const InputHandler&) = delete; |
| 100 | |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 101 | struct ScrollStatus { |
| 102 | ScrollStatus() |
| 103 | : thread(SCROLL_ON_IMPL_THREAD), |
danakj | 3590476 | 2016-01-21 20:49:40 | [diff] [blame] | 104 | main_thread_scrolling_reasons( |
Sahel Sharify | dbafed5 | 2017-08-03 16:59:12 | [diff] [blame] | 105 | MainThreadScrollingReason::kNotScrollingOnMain), |
| 106 | bubble(false) {} |
danakj | 3590476 | 2016-01-21 20:49:40 | [diff] [blame] | 107 | ScrollStatus(ScrollThread thread, uint32_t main_thread_scrolling_reasons) |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 108 | : thread(thread), |
| 109 | main_thread_scrolling_reasons(main_thread_scrolling_reasons) {} |
| 110 | ScrollThread thread; |
danakj | 3590476 | 2016-01-21 20:49:40 | [diff] [blame] | 111 | uint32_t main_thread_scrolling_reasons; |
Sahel Sharify | dbafed5 | 2017-08-03 16:59:12 | [diff] [blame] | 112 | bool bubble; |
tdresser | 81e84c67 | 2016-01-18 23:21:22 | [diff] [blame] | 113 | }; |
| 114 | |
sahel | ca206ad | 2019-02-08 16:30:06 | [diff] [blame] | 115 | enum ScrollInputType { TOUCHSCREEN, WHEEL, AUTOSCROLL, SCROLL_INPUT_UNKNOWN }; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 116 | |
Dave Tapuska | 75fe739 | 2017-06-05 14:01:26 | [diff] [blame] | 117 | enum class TouchStartOrMoveEventListenerType { |
lanwei | 53c1236 | 2016-11-29 06:51:17 | [diff] [blame] | 118 | NO_HANDLER, |
| 119 | HANDLER, |
| 120 | HANDLER_ON_SCROLLING_LAYER |
| 121 | }; |
| 122 | |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 123 | // Binds a client to this handler to receive notifications. Only one client |
| 124 | // can be bound to an InputHandler. The client must live at least until the |
| 125 | // handler calls WillShutdown() on the client. |
Sahel Sharify | e6d81f47 | 2018-07-11 20:40:26 | [diff] [blame] | 126 | virtual void BindToClient(InputHandlerClient* client) = 0; |
[email protected] | 200a9c06 | 2013-05-20 04:34:37 | [diff] [blame] | 127 | |
majidvp | 944a8cd | 2016-01-12 21:05:18 | [diff] [blame] | 128 | // Selects a layer to be scrolled using the |scroll_state| start position. |
| 129 | // Returns SCROLL_STARTED if the layer at the coordinates can be scrolled, |
| 130 | // SCROLL_ON_MAIN_THREAD if the scroll event should instead be delegated to |
| 131 | // the main thread, or SCROLL_IGNORED if there is nothing to be scrolled at |
| 132 | // the given coordinates. |
| 133 | virtual ScrollStatus ScrollBegin(ScrollState* scroll_state, |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 134 | ScrollInputType type) = 0; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 135 | |
hush | 1c87323 | 2015-06-23 21:22:11 | [diff] [blame] | 136 | // Similar to ScrollBegin, except the hit test is skipped and scroll always |
| 137 | // targets at the root layer. |
majidvp | 944a8cd | 2016-01-12 21:05:18 | [diff] [blame] | 138 | virtual ScrollStatus RootScrollBegin(ScrollState* scroll_state, |
| 139 | ScrollInputType type) = 0; |
dtapuska | 1827dd2 | 2016-03-11 15:24:59 | [diff] [blame] | 140 | |
| 141 | // Returns SCROLL_ON_IMPL_THREAD if a layer is actively being scrolled or |
| 142 | // a subsequent call to ScrollAnimated can begin on the impl thread. |
sahel | 60b41cdf | 2017-06-26 21:34:17 | [diff] [blame] | 143 | virtual ScrollStatus ScrollAnimatedBegin(ScrollState* scroll_state) = 0; |
dtapuska | 1827dd2 | 2016-03-11 15:24:59 | [diff] [blame] | 144 | |
ymalik | ddfc352 | 2016-09-05 18:40:37 | [diff] [blame] | 145 | // Returns SCROLL_ON_IMPL_THREAD if an animation is initiated on the impl |
| 146 | // thread. delayed_by is the delay that is taken into account when determining |
| 147 | // the duration of the animation. |
[email protected] | 749cbc6 | 2014-07-10 01:06:35 | [diff] [blame] | 148 | virtual ScrollStatus ScrollAnimated(const gfx::Point& viewport_point, |
ymalik | ddfc352 | 2016-09-05 18:40:37 | [diff] [blame] | 149 | const gfx::Vector2dF& scroll_delta, |
| 150 | base::TimeDelta delayed_by) = 0; |
[email protected] | 749cbc6 | 2014-07-10 01:06:35 | [diff] [blame] | 151 | |
majidvp | 944a8cd | 2016-01-12 21:05:18 | [diff] [blame] | 152 | // Scroll the layer selected by |ScrollBegin| by given |scroll_state| delta. |
| 153 | // Internally, the delta is transformed to local layer's coordinate space for |
| 154 | // scrolls gestures that are direct manipulation (e.g. touch). If there is no |
| 155 | // room to move the layer in the requested direction, its first ancestor layer |
| 156 | // that can be scrolled will be moved instead. The return value's |did_scroll| |
| 157 | // field is set to false if no layer can be moved in the requested direction |
| 158 | // at all, and set to true if any layer is moved. If the scroll delta hits the |
| 159 | // root layer, and the layer can no longer move, the root overscroll |
| 160 | // accumulated within this ScrollBegin() scope is reported in the return |
| 161 | // value's |accumulated_overscroll| field. Should only be called if |
| 162 | // ScrollBegin() returned SCROLL_STARTED. |
| 163 | virtual InputHandlerScrollResult ScrollBy(ScrollState* scroll_state) = 0; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 164 | |
[email protected] | 47a723f | 2014-03-05 12:42:49 | [diff] [blame] | 165 | virtual void MouseMoveAt(const gfx::Point& mouse_position) = 0; |
chaopeng | 54c1c28 | 2016-09-30 21:17:09 | [diff] [blame] | 166 | virtual void MouseDown() = 0; |
| 167 | virtual void MouseUp() = 0; |
chaopeng | fff2d5a | 2016-10-13 15:42:01 | [diff] [blame] | 168 | virtual void MouseLeave() = 0; |
[email protected] | bf1cfd9a | 2013-09-26 05:43:02 | [diff] [blame] | 169 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 170 | // Stop scrolling the selected layer. Should only be called if ScrollBegin() |
Sandra Sun | 04ed456 | 2018-01-16 01:49:35 | [diff] [blame] | 171 | // returned SCROLL_STARTED. Snap to a snap position if |should_snap| is true. |
| 172 | virtual void ScrollEnd(ScrollState* scroll_state, bool should_snap) = 0; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 173 | |
danakj | dd74e51 | 2015-09-21 23:07:59 | [diff] [blame] | 174 | // Requests a callback to UpdateRootLayerStateForSynchronousInputHandler() |
| 175 | // giving the current root scroll and page scale information. |
| 176 | virtual void RequestUpdateForSynchronousInputHandler() = 0; |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 177 | |
danakj | dd74e51 | 2015-09-21 23:07:59 | [diff] [blame] | 178 | // Called when the root scroll offset has been changed in the synchronous |
| 179 | // input handler by the application (outside of input event handling). |
| 180 | virtual void SetSynchronousInputHandlerRootScrollOffset( |
danakj | 0481b57 | 2015-09-10 01:18:01 | [diff] [blame] | 181 | const gfx::ScrollOffset& root_offset) = 0; |
[email protected] | 1960a71 | 2013-04-30 17:06:47 | [diff] [blame] | 182 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 183 | virtual void PinchGestureBegin() = 0; |
[email protected] | 47a723f | 2014-03-05 12:42:49 | [diff] [blame] | 184 | virtual void PinchGestureUpdate(float magnify_delta, |
| 185 | const gfx::Point& anchor) = 0; |
Sean O'Brien | 09fb8b7 | 2017-11-30 20:45:47 | [diff] [blame] | 186 | virtual void PinchGestureEnd(const gfx::Point& anchor, bool snap_to_min) = 0; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 187 | |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 188 | // Request another callback to InputHandlerClient::Animate(). |
hush | b0ee8dc | 2015-06-10 00:48:57 | [diff] [blame] | 189 | virtual void SetNeedsAnimateInput() = 0; |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 190 | |
bokan | e248130 | 2016-10-03 23:01:07 | [diff] [blame] | 191 | // Returns true if there is an active scroll on the viewport. |
| 192 | virtual bool IsCurrentlyScrollingViewport() const = 0; |
danakj | e9f830c | 2015-09-09 21:36:16 | [diff] [blame] | 193 | |
[email protected] | edcc1a1 | 2014-05-06 01:26:39 | [diff] [blame] | 194 | // Whether the layer under |viewport_point| is the currently scrolling layer. |
| 195 | virtual bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, |
danakj | e9f830c | 2015-09-09 21:36:16 | [diff] [blame] | 196 | ScrollInputType type) const = 0; |
[email protected] | edcc1a1 | 2014-05-06 01:26:39 | [diff] [blame] | 197 | |
dtapuska | f206a40d | 2016-02-05 21:36:02 | [diff] [blame] | 198 | virtual EventListenerProperties GetEventListenerProperties( |
| 199 | EventListenerClass event_class) const = 0; |
rbyers | 18779d82 | 2015-02-05 06:22:06 | [diff] [blame] | 200 | |
sunxd | 3e3a37a7 | 2018-07-06 22:58:43 | [diff] [blame] | 201 | // Returns true if |viewport_point| hits a wheel event handler region that |
| 202 | // could block scrolling. |
sunxd | 9f98e81 | 2018-08-16 15:34:49 | [diff] [blame] | 203 | virtual bool HasBlockingWheelEventHandlerAt( |
sunxd | 3e3a37a7 | 2018-07-06 22:58:43 | [diff] [blame] | 204 | const gfx::Point& viewport_point) const = 0; |
| 205 | |
Dave Tapuska | 75fe739 | 2017-06-05 14:01:26 | [diff] [blame] | 206 | // It returns the type of a touch start or move event listener at |
| 207 | // |viewport_point|. Whether the page should be given the opportunity to |
| 208 | // suppress scrolling by consuming touch events that started at |
| 209 | // |viewport_point|, and whether |viewport_point| is on the currently |
| 210 | // scrolling layer. |
Hayley Ferr | 2b14e2a6c | 2017-07-04 17:34:43 | [diff] [blame] | 211 | // |out_touch_action| is assigned the whitelisted touch action for the |
| 212 | // |viewport_point|. In the case there are no touch handlers or touch action |
| 213 | // regions, |out_touch_action| is assigned kTouchActionAuto since the default |
| 214 | // touch action is auto. |
Dave Tapuska | 75fe739 | 2017-06-05 14:01:26 | [diff] [blame] | 215 | virtual TouchStartOrMoveEventListenerType |
Hayley Ferr | 2b14e2a6c | 2017-07-04 17:34:43 | [diff] [blame] | 216 | EventListenerTypeForTouchStartOrMoveAt(const gfx::Point& viewport_point, |
| 217 | TouchAction* out_touch_action) = 0; |
[email protected] | 2f1acc26 | 2012-11-16 21:42:22 | [diff] [blame] | 218 | |
[email protected] | 6be422b | 2013-12-08 06:47:31 | [diff] [blame] | 219 | // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped |
| 220 | // LatencyInfoSwapPromiseMonitor. During the life time of the |
| 221 | // LatencyInfoSwapPromiseMonitor, if SetNeedsRedraw() or SetNeedsRedrawRect() |
| 222 | // is called on LayerTreeHostImpl, the original latency info will be turned |
| 223 | // into a LatencyInfoSwapPromise. |
danakj | 60bc3bc | 2016-04-09 00:24:48 | [diff] [blame] | 224 | virtual std::unique_ptr<SwapPromiseMonitor> |
| 225 | CreateLatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency) = 0; |
[email protected] | b76329d | 2013-06-11 04:15:08 | [diff] [blame] | 226 | |
ccameron | 4163cc35 | 2014-11-13 19:06:36 | [diff] [blame] | 227 | virtual ScrollElasticityHelper* CreateScrollElasticityHelper() = 0; |
| 228 | |
tapted | 4b70c52 | 2016-08-13 09:09:32 | [diff] [blame] | 229 | // Called by the single-threaded UI Compositor to get or set the scroll offset |
Robert Flack | b62bd42 | 2018-07-25 14:54:42 | [diff] [blame] | 230 | // on the impl side. Returns false if |element_id| isn't in the active tree. |
| 231 | virtual bool GetScrollOffsetForLayer(ElementId element_id, |
tapted | 4b70c52 | 2016-08-13 09:09:32 | [diff] [blame] | 232 | gfx::ScrollOffset* offset) = 0; |
Robert Flack | b62bd42 | 2018-07-25 14:54:42 | [diff] [blame] | 233 | virtual bool ScrollLayerTo(ElementId element_id, |
| 234 | const gfx::ScrollOffset& offset) = 0; |
tapted | 4b70c52 | 2016-08-13 09:09:32 | [diff] [blame] | 235 | |
sahel | fad903f | 2017-03-31 21:00:41 | [diff] [blame] | 236 | virtual bool ScrollingShouldSwitchtoMainThread() = 0; |
| 237 | |
Sandra Sun | eb85637d | 2018-03-22 22:35:16 | [diff] [blame] | 238 | // Sets the initial and target offset for scroll snapping for the currently |
| 239 | // scrolling node and the given natural displacement. |
Sandra Sun | 6141310 | 2018-04-09 22:24:43 | [diff] [blame] | 240 | // |natural_displacement_in_viewport| is the estimated total scrolling for |
| 241 | // the active scroll sequence. |
Sandra Sun | eb85637d | 2018-03-22 22:35:16 | [diff] [blame] | 242 | // Returns false if their is no position to snap to. |
Sandra Sun | 6141310 | 2018-04-09 22:24:43 | [diff] [blame] | 243 | virtual bool GetSnapFlingInfo( |
| 244 | const gfx::Vector2dF& natural_displacement_in_viewport, |
| 245 | gfx::Vector2dF* initial_offset, |
| 246 | gfx::Vector2dF* target_offset) const = 0; |
Sandra Sun | eb85637d | 2018-03-22 22:35:16 | [diff] [blame] | 247 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 248 | protected: |
Vladimir Levin | f06d1cd7 | 2019-03-13 18:24:10 | [diff] [blame^] | 249 | InputHandler() = default; |
| 250 | virtual ~InputHandler() = default; |
[email protected] | 5ff3c978 | 2013-04-29 17:35:12 | [diff] [blame] | 251 | }; |
| 252 | |
[email protected] | c1bb5af | 2013-03-13 19:06:27 | [diff] [blame] | 253 | } // namespace cc |
[email protected] | cd57cc5a | 2012-10-12 22:43:41 | [diff] [blame] | 254 | |
[email protected] | 3052b10f | 2013-03-18 07:41:21 | [diff] [blame] | 255 | #endif // CC_INPUT_INPUT_HANDLER_H_ |