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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2683763004: Pass MouseUp to the captured scrollbar animation controller in layer tree (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3222 matching lines...) Expand 10 before | Expand all | Expand 10 after
3233 } 3233 }
3234 3234
3235 void LayerTreeHostImpl::MouseDown() { 3235 void LayerTreeHostImpl::MouseDown() {
3236 ScrollbarAnimationController* animation_controller = 3236 ScrollbarAnimationController* animation_controller =
3237 ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_); 3237 ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_);
3238 if (animation_controller) 3238 if (animation_controller)
3239 animation_controller->DidMouseDown(); 3239 animation_controller->DidMouseDown();
3240 } 3240 }
3241 3241
3242 void LayerTreeHostImpl::MouseUp() { 3242 void LayerTreeHostImpl::MouseUp() {
3243 ScrollbarAnimationController* animation_controller = 3243 for (auto& pair : scrollbar_animation_controllers_)
bokan 2017/02/10 15:56:40 This only needs to notify the one captured scrollb
3244 ScrollbarAnimationControllerForId(scroll_layer_id_mouse_currently_over_); 3244 pair.second->DidMouseUp();
3245 if (animation_controller)
3246 animation_controller->DidMouseUp();
3247 } 3245 }
3248 3246
3249 void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) { 3247 void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
3250 gfx::PointF device_viewport_point = gfx::ScalePoint( 3248 gfx::PointF device_viewport_point = gfx::ScalePoint(
3251 gfx::PointF(viewport_point), active_tree_->device_scale_factor()); 3249 gfx::PointF(viewport_point), active_tree_->device_scale_factor());
3252 LayerImpl* layer_impl = 3250 LayerImpl* layer_impl =
3253 active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); 3251 active_tree_->FindLayerThatIsHitByPoint(device_viewport_point);
3254 3252
3255 // Check if mouse is over a scrollbar or not. 3253 // Check if mouse is over a scrollbar or not.
3256 // TODO(sahel): get rid of this extera checking when 3254 // TODO(sahel): get rid of this extera checking when
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
4085 worker_context_visibility_ = 4083 worker_context_visibility_ =
4086 worker_context->CacheController()->ClientBecameVisible(); 4084 worker_context->CacheController()->ClientBecameVisible();
4087 } else { 4085 } else {
4088 worker_context->CacheController()->ClientBecameNotVisible( 4086 worker_context->CacheController()->ClientBecameNotVisible(
4089 std::move(worker_context_visibility_)); 4087 std::move(worker_context_visibility_));
4090 } 4088 }
4091 } 4089 }
4092 } 4090 }
4093 4091
4094 } // namespace cc 4092 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698