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

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

Issue 2931703002: Don't fade in overlay scrollbar when user interacting the content under scrollbar. (Closed)
Patch Set: Created 3 years, 6 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
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 3469 matching lines...) Expand 10 before | Expand all | Expand 10 after
3480 ScrollbarAnimationControllerForElementId( 3480 ScrollbarAnimationControllerForElementId(
3481 scroll_element_id_mouse_currently_captured_); 3481 scroll_element_id_mouse_currently_captured_);
3482 3482
3483 scroll_element_id_mouse_currently_captured_ = ElementId(); 3483 scroll_element_id_mouse_currently_captured_ = ElementId();
3484 3484
3485 if (animation_controller) 3485 if (animation_controller)
3486 animation_controller->DidMouseUp(); 3486 animation_controller->DidMouseUp();
3487 } 3487 }
3488 } 3488 }
3489 3489
3490 void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) { 3490 void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point,
3491 bool is_mouse_down) {
3491 gfx::PointF device_viewport_point = gfx::ScalePoint( 3492 gfx::PointF device_viewport_point = gfx::ScalePoint(
3492 gfx::PointF(viewport_point), active_tree_->device_scale_factor()); 3493 gfx::PointF(viewport_point), active_tree_->device_scale_factor());
3493 LayerImpl* layer_impl = 3494 LayerImpl* layer_impl =
3494 active_tree_->FindLayerThatIsHitByPoint(device_viewport_point); 3495 active_tree_->FindLayerThatIsHitByPoint(device_viewport_point);
3495 3496
3496 // Check if mouse is over a scrollbar or not. 3497 // Check if mouse is over a scrollbar or not.
3497 // TODO(sahel): get rid of this extera checking when 3498 // TODO(sahel): get rid of this extera checking when
3498 // FindScrollNodeForDeviceViewportPoint finds the proper node for scrolling on 3499 // FindScrollNodeForDeviceViewportPoint finds the proper node for scrolling on
3499 // the main thread when the mouse is over a scrollbar as well. 3500 // the main thread when the mouse is over a scrollbar as well.
3500 ElementId scroll_element_id; 3501 ElementId scroll_element_id;
(...skipping 22 matching lines...) Expand all
3523 old_animation_controller->DidMouseLeave(); 3524 old_animation_controller->DidMouseLeave();
3524 } 3525 }
3525 scroll_element_id_mouse_currently_over_ = scroll_element_id; 3526 scroll_element_id_mouse_currently_over_ = scroll_element_id;
3526 } 3527 }
3527 3528
3528 ScrollbarAnimationController* new_animation_controller = 3529 ScrollbarAnimationController* new_animation_controller =
3529 ScrollbarAnimationControllerForElementId(scroll_element_id); 3530 ScrollbarAnimationControllerForElementId(scroll_element_id);
3530 if (!new_animation_controller) 3531 if (!new_animation_controller)
3531 return; 3532 return;
3532 3533
3533 new_animation_controller->DidMouseMove(device_viewport_point); 3534 new_animation_controller->DidMouseMove(device_viewport_point, is_mouse_down);
3534 } 3535 }
3535 3536
3536 void LayerTreeHostImpl::MouseLeave() { 3537 void LayerTreeHostImpl::MouseLeave() {
3537 for (auto& pair : scrollbar_animation_controllers_) 3538 for (auto& pair : scrollbar_animation_controllers_)
3538 pair.second->DidMouseLeave(); 3539 pair.second->DidMouseLeave();
3539 scroll_element_id_mouse_currently_over_ = ElementId(); 3540 scroll_element_id_mouse_currently_over_ = ElementId();
3540 } 3541 }
3541 3542
3542 void LayerTreeHostImpl::PinchGestureBegin() { 3543 void LayerTreeHostImpl::PinchGestureBegin() {
3543 pinch_gesture_active_ = true; 3544 pinch_gesture_active_ = true;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
4299 4300
4300 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) { 4301 void LayerTreeHostImpl::ShowScrollbarsForImplScroll(ElementId element_id) {
4301 if (!element_id) 4302 if (!element_id)
4302 return; 4303 return;
4303 if (ScrollbarAnimationController* animation_controller = 4304 if (ScrollbarAnimationController* animation_controller =
4304 ScrollbarAnimationControllerForElementId(element_id)) 4305 ScrollbarAnimationControllerForElementId(element_id))
4305 animation_controller->DidScrollUpdate(); 4306 animation_controller->DidScrollUpdate();
4306 } 4307 }
4307 4308
4308 } // namespace cc 4309 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698