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

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

Issue 2197503002: Route Scroll events through a cc::InputHandler Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollWheelAsScrollEvent
Patch Set: Abandon DeliverInputForBeginFrame: will not help fix the header row Created 4 years 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
« no previous file with comments | « ui/compositor/overscroll/ui_scroll_input_manager.h ('k') | ui/views/controls/scroll_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
OLDNEW
« no previous file with comments | « ui/compositor/overscroll/ui_scroll_input_manager.h ('k') | ui/views/controls/scroll_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698