| 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_INPUT_HANLDER_H_ |
| 6 #define UI_COMPOSITOR_OVERSCROLL_UI_INPUT_HANLDER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
| 10 #include "cc/input/input_handler.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 class ScrollEvent; |
| 15 |
| 16 // Class to feed UI-thread scroll events to a cc::InputHandler. Inspired by |
| 17 // ui::InputHandlerProxy but greatly simplified. |
| 18 class UIInputHandler : public cc::InputHandlerClient { |
| 19 public: |
| 20 explicit UIInputHandler(const base::WeakPtr<cc::InputHandler>& input_handler); |
| 21 ~UIInputHandler() override; |
| 22 |
| 23 // Ask the InputHandler to scroll |element| according to |scroll|. |
| 24 void HandleScrollUpdate(const ScrollEvent& scroll, cc::ElementId element); |
| 25 |
| 26 // Informs the InputHandler of the end of the event stream. |
| 27 void HandleScrollEnd(const ScrollEvent& scroll); |
| 28 |
| 29 // cc::InputHandlerClient implementation. |
| 30 void WillShutdown() override; |
| 31 void Animate(base::TimeTicks time) override; |
| 32 void MainThreadHasStoppedFlinging() override; |
| 33 void ReconcileElasticOverscrollAndRootScroll() override; |
| 34 void UpdateRootLayerStateForSynchronousInputHandler( |
| 35 const gfx::ScrollOffset& total_scroll_offset, |
| 36 const gfx::ScrollOffset& max_scroll_offset, |
| 37 const gfx::SizeF& scrollable_size, |
| 38 float page_scale_factor, |
| 39 float min_page_scale_factor, |
| 40 float max_page_scale_factor) override; |
| 41 void DeliverInputForBeginFrame() override; |
| 42 |
| 43 private: |
| 44 cc::InputHandler* input_handler_; // Weak. Cleared in WillShutdown(). |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(UIInputHandler); |
| 47 }; |
| 48 |
| 49 } // namespace ui |
| 50 |
| 51 #endif // UI_COMPOSITOR_OVERSCROLL_UI_INPUT_HANLDER_H_ |
| OLD | NEW |