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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2611013002: Show Overlay Scrollbar when GestureScrollUpdate (Closed)
Patch Set: bokan comments addressed Created 3 years, 10 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_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 132616ef303232e01822a4a4dd03ebb7dd1dbb86..4cd466553ca261e4e3f51a51b753fb1955ed1fcc 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2856,6 +2856,17 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated(
MainThreadScrollingReason::kNotScrollingOnMain;
ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
ScrollNode* scroll_node = scroll_tree.CurrentlyScrollingNode();
+
+ LayerImpl* currently_scrolling_layer = CurrentlyScrollingLayer();
+
+ if (currently_scrolling_layer) {
+ ScrollbarAnimationController* animation_controller =
+ ScrollbarAnimationControllerForId(currently_scrolling_layer->id());
+
+ if (animation_controller)
+ animation_controller->WillUpdateScroll();
+ }
+
if (scroll_node) {
gfx::Vector2dF delta = scroll_delta;
if (!scroll_node->user_scrollable_horizontal)
@@ -3142,9 +3153,17 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
DCHECK(scroll_state);
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy");
- if (!CurrentlyScrollingLayer())
+
+ LayerImpl* currently_scrolling_layer = CurrentlyScrollingLayer();
+ if (!currently_scrolling_layer)
return InputHandlerScrollResult();
+ ScrollbarAnimationController* animation_controller =
+ ScrollbarAnimationControllerForId(currently_scrolling_layer->id());
+
+ if (animation_controller)
+ animation_controller->WillUpdateScroll();
+
float initial_top_controls_offset =
browser_controls_offset_manager_->ControlsTopOffset();

Powered by Google App Engine
This is Rietveld 408576698