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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2683763004: Pass MouseUp to the captured scrollbar animation controller in layer tree (Closed)
Patch Set: bokan's comment 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ecf60cf97cc12578d03d7175fa08acc1dd916b00..215e716f49ff6c4ade8fe4c4ef124f96ca1f63a1 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -247,6 +247,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
max_memory_needed_bytes_(0),
resourceless_software_draw_(false),
mutator_host_(std::move(mutator_host)),
+ captured_scrollbar_animation_controller_(nullptr),
rendering_stats_instrumentation_(rendering_stats_instrumentation),
micro_benchmark_controller_(this),
task_graph_runner_(task_graph_runner),
@@ -3235,15 +3236,17 @@ float LayerTreeHostImpl::DeviceSpaceDistanceToLayer(
void LayerTreeHostImpl::MouseDown() {
ScrollbarAnimationController* animation_controller =
ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_);
- if (animation_controller)
+ if (animation_controller) {
animation_controller->DidMouseDown();
+ captured_scrollbar_animation_controller_ = animation_controller;
+ }
}
void LayerTreeHostImpl::MouseUp() {
- ScrollbarAnimationController* animation_controller =
- ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_);
- if (animation_controller)
- animation_controller->DidMouseUp();
+ if (captured_scrollbar_animation_controller_) {
+ captured_scrollbar_animation_controller_->DidMouseUp();
+ captured_scrollbar_animation_controller_ = nullptr;
+ }
}
void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698