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

Unified Diff: cc/layers/scrollbar_layer_impl_base.cc

Issue 146713002: Revert of Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/layers/scrollbar_layer_impl_base.h ('k') | cc/layers/scrollbar_layer_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/scrollbar_layer_impl_base.cc
diff --git a/cc/layers/scrollbar_layer_impl_base.cc b/cc/layers/scrollbar_layer_impl_base.cc
index 22583a141806a053565c955dd51d940949d6507f..55f46f51d846fe0fe074735abd315c6007dd49f7 100644
--- a/cc/layers/scrollbar_layer_impl_base.cc
+++ b/cc/layers/scrollbar_layer_impl_base.cc
@@ -5,7 +5,7 @@
#include "cc/layers/scrollbar_layer_impl_base.h"
#include <algorithm>
-#include "cc/trees/layer_tree_impl.h"
+#include "cc/layers/layer.h"
#include "ui/gfx/rect_conversions.h"
namespace cc {
@@ -14,12 +14,10 @@
LayerTreeImpl* tree_impl,
int id,
ScrollbarOrientation orientation,
- bool is_left_side_vertical_scrollbar,
- bool is_overlay)
+ bool is_left_side_vertical_scrollbar)
: LayerImpl(tree_impl, id),
- scroll_layer_(NULL),
- clip_layer_(NULL),
- is_overlay_scrollbar_(is_overlay),
+ scroll_layer_id_(Layer::INVALID_ID),
+ is_overlay_scrollbar_(false),
thumb_thickness_scale_factor_(1.f),
current_pos_(0.f),
maximum_(0),
@@ -28,48 +26,12 @@
vertical_adjust_(0.f),
visible_to_total_length_ratio_(1.f) {}
-ScrollbarLayerImplBase::~ScrollbarLayerImplBase() {
-}
-
void ScrollbarLayerImplBase::PushPropertiesTo(LayerImpl* layer) {
LayerImpl::PushPropertiesTo(layer);
- DCHECK(layer->ToScrollbarLayer());
- layer->ToScrollbarLayer()->set_is_overlay_scrollbar(is_overlay_scrollbar_);
- PushScrollClipPropertiesTo(layer);
-}
-
-void ScrollbarLayerImplBase::PushScrollClipPropertiesTo(LayerImpl* layer) {
- DCHECK(layer->ToScrollbarLayer());
- layer->ToScrollbarLayer()->SetScrollLayerById(ScrollLayerId());
- layer->ToScrollbarLayer()->SetClipLayerById(ClipLayerId());
}
ScrollbarLayerImplBase* ScrollbarLayerImplBase::ToScrollbarLayer() {
return this;
-}
-
-void ScrollbarLayerImplBase::SetScrollLayerById(int id) {
- LayerImpl* scroll_layer = layer_tree_impl()->LayerById(id);
- if (scroll_layer_ == scroll_layer)
- return;
-
- if (scroll_layer_)
- scroll_layer_->RemoveScrollbar(this);
- scroll_layer_ = scroll_layer;
- if (scroll_layer_)
- scroll_layer_->AddScrollbar(this);
-}
-
-void ScrollbarLayerImplBase::SetClipLayerById(int id) {
- LayerImpl* clip_layer = layer_tree_impl()->LayerById(id);
- if (clip_layer_ == clip_layer)
- return;
-
- if (clip_layer_)
- clip_layer_->RemoveScrollbar(this);
- clip_layer_ = clip_layer;
- if (clip_layer_)
- clip_layer_->AddScrollbar(this);
}
gfx::Rect ScrollbarLayerImplBase::ScrollbarLayerRectToContentRect(
@@ -215,11 +177,4 @@
return ScrollbarLayerRectToContentRect(thumb_rect);
}
-void ScrollbarLayerImplBase::ScrollbarParametersDidChange() {
- if (!clip_layer_ || !scroll_layer_)
- return;
-
- scroll_layer_->SetScrollbarPosition(this, clip_layer_);
-}
-
} // namespace cc
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.h ('k') | cc/layers/scrollbar_layer_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698