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

Unified Diff: cc/trees/tree_scroll_elasticity_client.h

Issue 704463003: Move overscroll bounce to impl thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/tree_scroll_elasticity_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/tree_scroll_elasticity_client.h
diff --git a/cc/trees/tree_scroll_elasticity_client.h b/cc/trees/tree_scroll_elasticity_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b5931741433b3f9055bc518de899fe011992403
--- /dev/null
+++ b/cc/trees/tree_scroll_elasticity_client.h
@@ -0,0 +1,46 @@
+// 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_TREE_SCROLL_ELASTICITY_CLIENT_H_
+#define CC_TREES_TREE_SCROLL_ELASTICITY_CLIENT_H_
+
+#include "cc/input/scroll_elasticity_controller.h"
+
+namespace cc {
+
+class LayerTreeHostImpl;
+
+class TreeScrollElasticityClient
+ : public ScrollElasticityControllerClient {
+ public:
+ TreeScrollElasticityClient(LayerTreeHostImpl* tree);
+ virtual ~TreeScrollElasticityClient();
+
+ ScrollElasticityController* controller() const { return controller_; }
+
+ // cc::ScrollElasticityControllerClient implementation:
+ void BindToController(ScrollElasticityController* controller) override;
+ bool allowsHorizontalStretching() const override;
+ bool allowsVerticalStretching() const override;
+ gfx::Vector2dF stretchAmount() const override;
+ bool pinnedInDirection(const gfx::Vector2dF& delta) const override;
+ bool canScrollHorizontally() const override;
+ bool canScrollVertically() const override;
+ gfx::Vector2dF absoluteScrollPosition() const override;
+ void immediateScrollBy(const gfx::Vector2dF& delta) override;
+ void immediateScrollByWithoutContentEdgeConstraints(const gfx::Vector2dF& delta) override;
+ void startSnapRubberbandTimer() override;
+ void stopSnapRubberbandTimer() override;
+ void adjustScrollPositionToBoundsIfNecessary() override;
+
+ private:
+ LayerTreeHostImpl* tree_;
+ gfx::Vector2dF stretch_offset_;
+ bool timer_active_;
+ ScrollElasticityController* controller_;
+};
+
+} // namespace cc
+
+#endif // CC_TREES_TREE_SCROLL_ELASTICITY_CLIENT_H_
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/tree_scroll_elasticity_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698