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

Unified Diff: ui/events/blink/input_scroll_elasticity_controller.h

Issue 2194833002: Overscroll and Elasticity for views::ScrollView Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-RouteThroughInputHandler
Patch Set: Restore functionality and fix bugs \o/ Created 4 years, 1 month 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
Index: ui/events/blink/input_scroll_elasticity_controller.h
diff --git a/ui/events/blink/input_scroll_elasticity_controller.h b/ui/events/blink/input_scroll_elasticity_controller.h
index 23ca00b48b274c8342024e3f6879f54ac5736513..68c5552ae9584af0957c2adc96c5a32cf012b5bc 100644
--- a/ui/events/blink/input_scroll_elasticity_controller.h
+++ b/ui/events/blink/input_scroll_elasticity_controller.h
@@ -45,11 +45,20 @@ namespace ui {
class InputScrollElasticityController {
public:
- explicit InputScrollElasticityController(cc::ScrollElasticityHelper* helper);
+ InputScrollElasticityController();
virtual ~InputScrollElasticityController();
base::WeakPtr<InputScrollElasticityController> GetWeakPtr();
+ void SetActiveHelper(const base::WeakPtr<cc::ScrollElasticityHelper>& helper);
+
+ void ObserveRealScrollBegin(bool enter_momentum, bool leave_momentum);
+ void ObserveScrollUpdate(const gfx::Vector2dF& event_delta,
+ const gfx::Vector2dF& unused_scroll_delta,
+ const base::TimeTicks& event_timestamp,
+ bool has_momentum);
+ void ObserveRealScrollEnd(const base::TimeTicks& event_timestamp);
+
// Update the overscroll state based a gesture event that has been processed.
// Note that this assumes that all events are coming from a single input
// device. If the user simultaneously uses multiple input devices, Cocoa may
@@ -106,7 +115,7 @@ class InputScrollElasticityController {
bool CanScrollHorizontally() const;
bool CanScrollVertically() const;
- cc::ScrollElasticityHelper* helper_;
+ base::WeakPtr<cc::ScrollElasticityHelper> helper_;
State state_;
// If there is no overscroll, require a minimum overscroll delta before
« no previous file with comments | « ui/events/blink/input_handler_proxy_unittest.cc ('k') | ui/events/blink/input_scroll_elasticity_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698