| 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:
|
| + // 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_
|
|
|