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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 18341009: Refactor cc scrollbar layers to separate solid-color vs desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address tfarina@'s comments. Created 7 years, 5 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
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 03d0100be421c881d100ff3ea908541d0d383dbd..097be13de751044f251db5ed050038fb2b178db8 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -10,7 +10,7 @@
#include "cc/debug/traced_value.h"
#include "cc/layers/heads_up_display_layer_impl.h"
#include "cc/layers/render_surface_impl.h"
-#include "cc/layers/scrollbar_layer_impl.h"
+#include "cc/layers/scrollbar_layer_impl_base.h"
#include "cc/trees/layer_tree_host_common.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "ui/gfx/size_conversions.h"
@@ -222,6 +222,9 @@ void LayerTreeImpl::UpdateMaxScrollOffset() {
root_scroll_layer_->SetMaxScrollOffset(gfx::ToFlooredVector2d(max_scroll));
}
+// TODO(wjmaclean) This needs to go away, and be replaced with a single core
+// of login that works for both scrollbar layer types. This is already planned
+// as part of the larger pinch-zoom re-factoring viewport.
void LayerTreeImpl::UpdateSolidColorScrollbars() {
DCHECK(settings().solid_color_scrollbars);
@@ -236,12 +239,14 @@ void LayerTreeImpl::UpdateSolidColorScrollbars() {
if (RootClipLayer())
vertical_adjust = layer_tree_host_impl_->VisibleViewportSize().height() -
RootClipLayer()->bounds().height();
- if (ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer()) {
+ if (ScrollbarLayerImplBase* horiz =
+ root_scroll->horizontal_scrollbar_layer()) {
horiz->set_vertical_adjust(vertical_adjust);
horiz->set_visible_to_total_length_ratio(
scrollable_viewport.width() / ScrollableSize().width());
}
- if (ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer()) {
+ if (ScrollbarLayerImplBase* vertical =
+ root_scroll->vertical_scrollbar_layer()) {
vertical->set_vertical_adjust(vertical_adjust);
vertical->set_visible_to_total_length_ratio(
scrollable_viewport.height() / ScrollableSize().height());

Powered by Google App Engine
This is Rietveld 408576698