| 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 #include "ui/compositor/overscroll/ui_scroll_input_manager.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "ui/compositor/layer.h" |
| 9 #include "ui/compositor/overscroll/ui_input_handler.h" |
| 10 #include "ui/events/event.h" |
| 11 |
| 12 namespace ui { |
| 13 |
| 14 UIScrollInputManager::UIScrollInputManager( |
| 15 const base::WeakPtr<cc::InputHandler>& input_handler) |
| 16 : input_wrapper_(new UIInputHandler(input_handler)) {} |
| 17 |
| 18 UIScrollInputManager::~UIScrollInputManager() {} |
| 19 |
| 20 bool UIScrollInputManager::OnScrollEvent(const ScrollEvent& event, |
| 21 Layer* layer_to_scroll) { |
| 22 // Note there is no "begin". Currently it's only needed for hit testing, |
| 23 // but UI already knows which layer should be scrolling. |
| 24 input_wrapper_->HandleScrollUpdate(event, layer_to_scroll->GetElementId()); |
| 25 if (event.momentum_phase() == EventMomentumPhase::END) |
| 26 input_wrapper_->HandleScrollEnd(event); |
| 27 return true; |
| 28 } |
| 29 |
| 30 } // namespace ui |
| OLD | NEW |