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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/overscroll/ui_scroll_input_manager.cc
diff --git a/ui/compositor/overscroll/ui_scroll_input_manager.cc b/ui/compositor/overscroll/ui_scroll_input_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cb2c1a5efd73032481863d752fc54488c49b5883
--- /dev/null
+++ b/ui/compositor/overscroll/ui_scroll_input_manager.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/overscroll/ui_scroll_input_manager.h"
+
+#include "base/logging.h"
+#include "ui/compositor/layer.h"
+#include "ui/compositor/overscroll/ui_input_handler.h"
+#include "ui/events/event.h"
+
+namespace ui {
+
+UIScrollInputManager::UIScrollInputManager(
+ const base::WeakPtr<cc::InputHandler>& input_handler)
+ : input_wrapper_(new UIInputHandler(input_handler)) {}
+
+UIScrollInputManager::~UIScrollInputManager() {}
+
+bool UIScrollInputManager::OnScrollEvent(const ScrollEvent& event,
+ Layer* layer_to_scroll) {
+ // Note there is no "begin". Currently it's only needed for hit testing,
+ // but UI already knows which layer should be scrolling.
+ input_wrapper_->HandleScrollUpdate(event, layer_to_scroll->GetElementId());
+ if (event.momentum_phase() == EventMomentumPhase::END)
+ input_wrapper_->HandleScrollEnd(event);
+ return true;
+}
+
+} // namespace ui
« 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