| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 12 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
| 13 #include "cc/input/event_listener_properties.h" | 14 #include "cc/input/event_listener_properties.h" |
| 14 #include "cc/input/main_thread_scrolling_reason.h" | 15 #include "cc/input/main_thread_scrolling_reason.h" |
| 15 #include "cc/input/scroll_state.h" | 16 #include "cc/input/scroll_state.h" |
| 16 #include "cc/input/scrollbar.h" | 17 #include "cc/input/scrollbar.h" |
| 17 #include "cc/trees/swap_promise_monitor.h" | 18 #include "cc/trees/swap_promise_monitor.h" |
| 18 | 19 |
| 19 namespace gfx { | 20 namespace gfx { |
| 20 class Point; | 21 class Point; |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 virtual bool DoTouchEventsBlockScrollAt(const gfx::Point& viewport_point) = 0; | 194 virtual bool DoTouchEventsBlockScrollAt(const gfx::Point& viewport_point) = 0; |
| 194 | 195 |
| 195 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped | 196 // Calling CreateLatencyInfoSwapPromiseMonitor() to get a scoped |
| 196 // LatencyInfoSwapPromiseMonitor. During the life time of the | 197 // LatencyInfoSwapPromiseMonitor. During the life time of the |
| 197 // LatencyInfoSwapPromiseMonitor, if SetNeedsRedraw() or SetNeedsRedrawRect() | 198 // LatencyInfoSwapPromiseMonitor, if SetNeedsRedraw() or SetNeedsRedrawRect() |
| 198 // is called on LayerTreeHostImpl, the original latency info will be turned | 199 // is called on LayerTreeHostImpl, the original latency info will be turned |
| 199 // into a LatencyInfoSwapPromise. | 200 // into a LatencyInfoSwapPromise. |
| 200 virtual std::unique_ptr<SwapPromiseMonitor> | 201 virtual std::unique_ptr<SwapPromiseMonitor> |
| 201 CreateLatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency) = 0; | 202 CreateLatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency) = 0; |
| 202 | 203 |
| 203 virtual ScrollElasticityHelper* CreateScrollElasticityHelper() = 0; | 204 virtual ScrollElasticityHelper* CreateRootScrollElasticityHelper() = 0; |
| 205 virtual base::WeakPtr<ScrollElasticityHelper> |
| 206 ScrollElasticityHelperForScrollingLayer() = 0; |
| 204 | 207 |
| 205 // Called by the single-threaded UI Compositor to get or set the scroll offset | 208 // Called by the single-threaded UI Compositor to get or set the scroll offset |
| 206 // on the impl side. Retruns false if |layer_id| isn't in the active tree. | 209 // on the impl side. Retruns false if |layer_id| isn't in the active tree. |
| 207 virtual bool GetScrollOffsetForLayer(int layer_id, | 210 virtual bool GetScrollOffsetForLayer(int layer_id, |
| 208 gfx::ScrollOffset* offset) = 0; | 211 gfx::ScrollOffset* offset) = 0; |
| 209 virtual bool ScrollLayerTo(int layer_id, const gfx::ScrollOffset& offset) = 0; | 212 virtual bool ScrollLayerTo(int layer_id, const gfx::ScrollOffset& offset) = 0; |
| 210 | 213 |
| 211 protected: | 214 protected: |
| 212 InputHandler() {} | 215 InputHandler() {} |
| 213 virtual ~InputHandler() {} | 216 virtual ~InputHandler() {} |
| 214 | 217 |
| 215 private: | 218 private: |
| 216 DISALLOW_COPY_AND_ASSIGN(InputHandler); | 219 DISALLOW_COPY_AND_ASSIGN(InputHandler); |
| 217 }; | 220 }; |
| 218 | 221 |
| 219 } // namespace cc | 222 } // namespace cc |
| 220 | 223 |
| 221 #endif // CC_INPUT_INPUT_HANDLER_H_ | 224 #endif // CC_INPUT_INPUT_HANDLER_H_ |
| OLD | NEW |