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

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 review comments; plumb scrollbar color via flag. Created 7 years, 4 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 70ad6de88fa5edde365ba486f17a46e3b6bab0f5..fe905a391c6098e5aca66fee437dcb9c004698aa 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"
@@ -244,6 +244,9 @@ void LayerTreeImpl::ApplySentScrollAndScaleDeltas() {
root_layer(), base::Bind(&ApplySentScrollDeltasOn));
}
+// 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);
@@ -258,12 +261,14 @@ void LayerTreeImpl::UpdateSolidColorScrollbars() {
if (RootContainerLayer())
vertical_adjust = layer_tree_host_impl_->VisibleViewportSize().height() -
RootContainerLayer()->bounds().height();
- if (ScrollbarLayerImpl* horiz = root_scroll->horizontal_scrollbar_layer()) {
+ if (ScrollbarLayerImplBase* horiz =
+ root_scroll->horizontal_scrollbar_layer()) {
horiz->SetVerticalAdjust(vertical_adjust);
horiz->SetVisibleToTotalLengthRatio(
scrollable_viewport.width() / ScrollableSize().width());
}
- if (ScrollbarLayerImpl* vertical = root_scroll->vertical_scrollbar_layer()) {
+ if (ScrollbarLayerImplBase* vertical =
+ root_scroll->vertical_scrollbar_layer()) {
vertical->SetVerticalAdjust(vertical_adjust);
vertical->SetVisibleToTotalLengthRatio(
scrollable_viewport.height() / ScrollableSize().height());

Powered by Google App Engine
This is Rietveld 408576698