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

Unified Diff: cc/trees/layer_tree_scroll_elasticity_client.h

Issue 713413002: Hook ScrollElasticityController to InputHandlerProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 6 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: cc/trees/layer_tree_scroll_elasticity_client.h
diff --git a/cc/trees/layer_tree_scroll_elasticity_client.h b/cc/trees/layer_tree_scroll_elasticity_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..30b38d4985b25fa5d21e10119e56f2eb4d80bb35
--- /dev/null
+++ b/cc/trees/layer_tree_scroll_elasticity_client.h
@@ -0,0 +1,53 @@
+// Copyright 2014 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 CC_TREES_LAYER_TREE_SCROLL_ELASTICITY_CLIENT_H_
+#define CC_TREES_LAYER_TREE_SCROLL_ELASTICITY_CLIENT_H_
+
+#include "cc/input/scroll_elasticity_controller.h"
+
+namespace cc {
+
+class LayerTreeHostImpl;
+
+// Interface between a LayerTreeHostImpl and a ScrollElasticityController. It
+// would be possible, in principle, for LayerTreeHostImpl to implement the
+// ScrollElasticityControllerClient interface itself. This artificial boundary
+// is introduced to reduce the amount of logic and state held directly inside
+// LayerTreeHostImpl.
+class CC_EXPORT LayerTreeScrollElasticityClient
+ : public ScrollElasticityControllerClient {
+ public:
+ explicit LayerTreeScrollElasticityClient(LayerTreeHostImpl* layer_tree);
+ virtual ~LayerTreeScrollElasticityClient();
+
+ // Interface between LayerTreeHostImpl and the controller.
+ void Animate(base::TimeTicks monotonic_time);
+
+ private:
aelias_OOO_until_Jul13 2014/11/12 22:17:59 I don't think this should be private in the subcla
ccameron 2014/11/13 00:28:37 This issue went away because of using a concrete c
+ // ScrollElasticityControllerClient implementation:
+ void BindToController(ScrollElasticityController* controller) override;
+ bool AllowsHorizontalStretching() override;
+ bool AllowsVerticalStretching() override;
+ gfx::Vector2dF StretchAmount() override;
+ bool PinnedInDirection(const gfx::Vector2dF& direction) override;
+ bool CanScrollHorizontally() override;
+ bool CanScrollVertically() override;
+ gfx::Vector2dF AbsoluteScrollPosition() override;
+ void ImmediateScrollBy(const gfx::Vector2dF& scroll) override;
+ void ImmediateScrollByWithoutContentEdgeConstraints(
+ const gfx::Vector2dF& scroll) override;
+ void StartSnapRubberbandTimer() override;
+ void StopSnapRubberbandTimer() override;
+ void AdjustScrollPositionToBoundsIfNecessary() override;
+
+ LayerTreeHostImpl* layer_tree_;
+ ScrollElasticityController* controller_;
+ gfx::Vector2dF stretch_offset_;
+ bool timer_active_;
+};
+
+} // namespace cc
+
+#endif // CC_TREES_LAYER_TREE_SCROLL_ELASTICITY_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698