| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_INPUT_HANDLER_H_ | 5 #ifndef CC_INPUT_INPUT_HANDLER_H_ |
| 6 #define CC_INPUT_INPUT_HANDLER_H_ | 6 #define CC_INPUT_INPUT_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 | 24 |
| 25 class LayerScrollOffsetDelegate; | 25 class LayerScrollOffsetDelegate; |
| 26 | 26 |
| 27 class CC_EXPORT InputHandlerClient { | 27 class CC_EXPORT InputHandlerClient { |
| 28 public: | 28 public: |
| 29 virtual ~InputHandlerClient() {} | 29 virtual ~InputHandlerClient() {} |
| 30 | 30 |
| 31 virtual void WillShutdown() = 0; | 31 virtual void WillShutdown() = 0; |
| 32 virtual void Animate(base::TimeTicks time) = 0; | 32 virtual void AnimateFling(base::TimeTicks time) = 0; |
| 33 virtual void MainThreadHasStoppedFlinging() = 0; | 33 virtual void MainThreadHasStoppedFlinging() = 0; |
| 34 | 34 |
| 35 // Called when scroll deltas reaching the root scrolling layer go unused. | 35 // Called when scroll deltas reaching the root scrolling layer go unused. |
| 36 // The accumulated overscroll is scoped by the most recent call to | 36 // The accumulated overscroll is scoped by the most recent call to |
| 37 // InputHandler::ScrollBegin. | 37 // InputHandler::ScrollBegin. |
| 38 virtual void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, | 38 virtual void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, |
| 39 const gfx::Vector2dF& latest_overscroll_delta) = 0; | 39 const gfx::Vector2dF& latest_overscroll_delta) = 0; |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 InputHandlerClient() {} | 42 InputHandlerClient() {} |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 virtual void PinchGestureBegin() = 0; | 117 virtual void PinchGestureBegin() = 0; |
| 118 virtual void PinchGestureUpdate(float magnify_delta, | 118 virtual void PinchGestureUpdate(float magnify_delta, |
| 119 const gfx::Point& anchor) = 0; | 119 const gfx::Point& anchor) = 0; |
| 120 virtual void PinchGestureEnd() = 0; | 120 virtual void PinchGestureEnd() = 0; |
| 121 | 121 |
| 122 virtual void StartPageScaleAnimation(const gfx::Vector2d& target_offset, | 122 virtual void StartPageScaleAnimation(const gfx::Vector2d& target_offset, |
| 123 bool anchor_point, | 123 bool anchor_point, |
| 124 float page_scale, | 124 float page_scale, |
| 125 base::TimeDelta duration) = 0; | 125 base::TimeDelta duration) = 0; |
| 126 | 126 |
| 127 // Request another callback to InputHandlerClient::Animate(). | 127 // Request another callback to InputHandlerClient::AnimateFling(). |
| 128 virtual void SetNeedsAnimate() = 0; | 128 virtual void SetNeedsAnimateFling() = 0; |
| 129 | 129 |
| 130 // Whether the layer under |viewport_point| is the currently scrolling layer. | 130 // Whether the layer under |viewport_point| is the currently scrolling layer. |
| 131 virtual bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, | 131 virtual bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, |
| 132 ScrollInputType type) = 0; | 132 ScrollInputType type) = 0; |
| 133 | 133 |
| 134 virtual bool HaveTouchEventHandlersAt(const gfx::Point& viewport_point) = 0; | 134 virtual bool HaveTouchEventHandlersAt(const gfx::Point& viewport_point) = 0; |
| 135 | 135 |
| 136 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped | 136 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped |
| 137 // LatencyInfoSwapPromiseMonitor. During the life time of the | 137 // LatencyInfoSwapPromiseMonitor. During the life time of the |
| 138 // LatencyInfoSwapPromiseMonitor, if SetNeedsRedraw() or SetNeedsRedrawRect() | 138 // LatencyInfoSwapPromiseMonitor, if SetNeedsRedraw() or SetNeedsRedrawRect() |
| 139 // is called on LayerTreeHostImpl, the original latency info will be turned | 139 // is called on LayerTreeHostImpl, the original latency info will be turned |
| 140 // into a LatencyInfoSwapPromise. | 140 // into a LatencyInfoSwapPromise. |
| 141 virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( | 141 virtual scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
| 142 ui::LatencyInfo* latency) = 0; | 142 ui::LatencyInfo* latency) = 0; |
| 143 | 143 |
| 144 protected: | 144 protected: |
| 145 InputHandler() {} | 145 InputHandler() {} |
| 146 virtual ~InputHandler() {} | 146 virtual ~InputHandler() {} |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 DISALLOW_COPY_AND_ASSIGN(InputHandler); | 149 DISALLOW_COPY_AND_ASSIGN(InputHandler); |
| 150 }; | 150 }; |
| 151 | 151 |
| 152 } // namespace cc | 152 } // namespace cc |
| 153 | 153 |
| 154 #endif // CC_INPUT_INPUT_HANDLER_H_ | 154 #endif // CC_INPUT_INPUT_HANDLER_H_ |
| OLD | NEW |