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

Unified Diff: ui/compositor/overscroll/ui_input_handler.h

Issue 1680613002: Adding momentum/overscroll to views:: ScrollViews Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Tableview layout. aaaand I think we are done Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/overscroll/DEPS ('k') | ui/compositor/overscroll/ui_input_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/overscroll/ui_input_handler.h
diff --git a/ui/compositor/overscroll/ui_input_handler.h b/ui/compositor/overscroll/ui_input_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..e52c0d593d354c4ac92a7df528cdc0c5364f01d8
--- /dev/null
+++ b/ui/compositor/overscroll/ui_input_handler.h
@@ -0,0 +1,50 @@
+// 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.
+
+#ifndef UI_COMPOSITOR_OVERSCROLL_UI_INPUT_HANLDER_H_
+#define UI_COMPOSITOR_OVERSCROLL_UI_INPUT_HANLDER_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "cc/input/input_handler.h"
+#include "ui/events/blink/input_scroll_elasticity_controller.h"
+
+namespace ui {
+
+class ScrollEvent;
+
+// Class to feed UI-thread scroll events to a cc::InputHandler. Inspired by
+// ui::InputHandlerProxy but greatly simplified.
+class UIInputHandler : public cc::InputHandlerClient {
+ public:
+ explicit UIInputHandler(const base::WeakPtr<cc::InputHandler>& input_handler);
+ ~UIInputHandler() override;
+
+ void HandleScrollBegin(const ScrollEvent& scroll);
+ void HandleScrollUpdate(const ScrollEvent& scroll);
+ void HandleScrollEnd(const ScrollEvent& scroll);
+
+ // cc::InputHandlerClient implementation.
+ void WillShutdown() override;
+ void Animate(base::TimeTicks time) override;
+ void MainThreadHasStoppedFlinging() override;
+ void ReconcileElasticOverscrollAndRootScroll() override;
+ void UpdateRootLayerStateForSynchronousInputHandler(
+ const gfx::ScrollOffset& total_scroll_offset,
+ const gfx::ScrollOffset& max_scroll_offset,
+ const gfx::SizeF& scrollable_size,
+ float page_scale_factor,
+ float min_page_scale_factor,
+ float max_page_scale_factor) override;
+
+ private:
+ cc::InputHandler* input_handler_;
+ InputScrollElasticityController scroll_elasticity_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(UIInputHandler);
+};
+
+} // namespace ui
+
+#endif // UI_COMPOSITOR_OVERSCROLL_UI_INPUT_HANLDER_H_
« no previous file with comments | « ui/compositor/overscroll/DEPS ('k') | ui/compositor/overscroll/ui_input_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698