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

Unified Diff: cc/input/scroll_elasticity_helper.cc

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « cc/input/scroll_elasticity_helper.h ('k') | cc/input/scrollbar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/scroll_elasticity_helper.cc
diff --git a/cc/input/scroll_elasticity_helper.cc b/cc/input/scroll_elasticity_helper.cc
deleted file mode 100644
index 1c496d905318d486c0171c710ff52d74d30d0c82..0000000000000000000000000000000000000000
--- a/cc/input/scroll_elasticity_helper.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// 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.
-
-#include "cc/input/scroll_elasticity_helper.h"
-
-#include "cc/layers/layer_impl.h"
-#include "cc/trees/layer_tree_host_impl.h"
-#include "cc/trees/layer_tree_impl.h"
-
-namespace cc {
-
-class ScrollElasticityHelperImpl : public ScrollElasticityHelper {
- public:
- explicit ScrollElasticityHelperImpl(LayerTreeHostImpl* layer_tree_host_impl);
- ~ScrollElasticityHelperImpl() override;
-
- bool IsUserScrollable() const override;
- gfx::Vector2dF StretchAmount() const override;
- void SetStretchAmount(const gfx::Vector2dF& stretch_amount) override;
- gfx::ScrollOffset ScrollOffset() const override;
- gfx::ScrollOffset MaxScrollOffset() const override;
- void ScrollBy(const gfx::Vector2dF& delta) override;
- void RequestAnimate() override;
-
- private:
- LayerTreeHostImpl* layer_tree_host_impl_;
-};
-
-ScrollElasticityHelperImpl::ScrollElasticityHelperImpl(
- LayerTreeHostImpl* layer_tree)
- : layer_tree_host_impl_(layer_tree) {
-}
-
-ScrollElasticityHelperImpl::~ScrollElasticityHelperImpl() {
-}
-
-bool ScrollElasticityHelperImpl::IsUserScrollable() const {
- LayerImpl* layer = layer_tree_host_impl_->OuterViewportScrollLayer();
- if (!layer)
- return false;
- return layer->user_scrollable_horizontal() ||
- layer->user_scrollable_vertical();
-}
-
-gfx::Vector2dF ScrollElasticityHelperImpl::StretchAmount() const {
- return layer_tree_host_impl_->active_tree()->elastic_overscroll()->Current(
- true);
-}
-
-void ScrollElasticityHelperImpl::SetStretchAmount(
- const gfx::Vector2dF& stretch_amount) {
- if (stretch_amount == StretchAmount())
- return;
-
- layer_tree_host_impl_->active_tree()->elastic_overscroll()->SetCurrent(
- stretch_amount);
- layer_tree_host_impl_->active_tree()->set_needs_update_draw_properties();
- layer_tree_host_impl_->SetNeedsCommit();
- layer_tree_host_impl_->SetNeedsRedraw();
- layer_tree_host_impl_->SetFullRootLayerDamage();
-}
-
-gfx::ScrollOffset ScrollElasticityHelperImpl::ScrollOffset() const {
- return layer_tree_host_impl_->active_tree()->TotalScrollOffset();
-}
-
-gfx::ScrollOffset ScrollElasticityHelperImpl::MaxScrollOffset() const {
- return layer_tree_host_impl_->active_tree()->TotalMaxScrollOffset();
-}
-
-void ScrollElasticityHelperImpl::ScrollBy(const gfx::Vector2dF& delta) {
- LayerImpl* root_scroll_layer =
- layer_tree_host_impl_->OuterViewportScrollLayer()
- ? layer_tree_host_impl_->OuterViewportScrollLayer()
- : layer_tree_host_impl_->InnerViewportScrollLayer();
- if (root_scroll_layer)
- root_scroll_layer->ScrollBy(delta);
-}
-
-void ScrollElasticityHelperImpl::RequestAnimate() {
- layer_tree_host_impl_->SetNeedsAnimate();
-}
-
-// static
-ScrollElasticityHelper* ScrollElasticityHelper::CreateForLayerTreeHostImpl(
- LayerTreeHostImpl* layer_tree_host_impl) {
- return new ScrollElasticityHelperImpl(layer_tree_host_impl);
-}
-
-} // namespace cc
« no previous file with comments | « cc/input/scroll_elasticity_helper.h ('k') | cc/input/scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698