| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_COMPOSITOR_OVERSCROLL_UI_SCROLL_INPUT_MANAGER_H_ |
| 6 #define UI_COMPOSITOR_OVERSCROLL_UI_SCROLL_INPUT_MANAGER_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "cc/trees/element_id.h" |
| 13 #include "ui/compositor/compositor_export.h" |
| 14 |
| 15 namespace cc { |
| 16 class InputHandler; |
| 17 } |
| 18 |
| 19 namespace ui { |
| 20 |
| 21 class Layer; |
| 22 class ScrollEvent; |
| 23 class UIInputHandler; |
| 24 |
| 25 // UI-Thread helper for directing scroll events to the Compositor to enable |
| 26 // accelerated scrolling, and elastic scrolling on Mac. |
| 27 class COMPOSITOR_EXPORT UIScrollInputManager { |
| 28 public: |
| 29 explicit UIScrollInputManager( |
| 30 const base::WeakPtr<cc::InputHandler>& input_handler); |
| 31 ~UIScrollInputManager(); |
| 32 |
| 33 // Scroll the given |layer_to_scroll| according to |event|. |
| 34 bool OnScrollEvent(const ScrollEvent& event, Layer* layer_to_scroll); |
| 35 |
| 36 private: |
| 37 std::unique_ptr<UIInputHandler> input_wrapper_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(UIScrollInputManager); |
| 40 }; |
| 41 |
| 42 } // namespace ui |
| 43 |
| 44 #endif // UI_COMPOSITOR_OVERSCROLL_UI_SCROLL_INPUT_MANAGER_H_ |
| OLD | NEW |