Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: ui/compositor/overscroll/ui_scroll_input_manager.cc

Issue 2189583004: [not for review - epic CL] Adding Elastic+Momentum+Layered scrolling to views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/overscroll/ui_input_handler.h"
9 #include "ui/events/event.h"
10
11 namespace ui {
12
13 UIScrollInputManager::UIScrollInputManager(
14 const base::WeakPtr<cc::InputHandler>& input_handler)
15 : input_wrapper_(new UIInputHandler(input_handler)) {}
16
17 UIScrollInputManager::~UIScrollInputManager() {}
18
19 bool UIScrollInputManager::OnScrollEvent(const ScrollEvent& event) {
20 // Decide whether to HandleScrollBegin() based only on whether the
21 // InputHandler last handled an "End" (i.e. do not use properties on |event|).
22 // This is because, on Mac, an event ending the non-fling portion of a scroll
23 // can't be distinguished from an event ending a scroll that won't fling. So,
24 // when handling the fling portion, HandleScrollBegin() must be invoked, even
25 // though |event| will not be a "begin" phase.
26 if (!scrolling_layer_)
27 scrolling_layer_ = input_wrapper_->HandleScrollBegin(event);
28 if (!scrolling_layer_)
29 return false;
30
31 input_wrapper_->HandleScrollUpdate(event, scrolling_layer_);
32 if (event.momentum_phase() == EventMomentumPhase::END) {
33 input_wrapper_->HandleScrollEnd(event);
34 scrolling_layer_ = cc::ElementId();
35 }
36 return true;
37 }
38
39 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/overscroll/ui_scroll_input_manager.h ('k') | ui/events/blink/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698