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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2358323003: Keep expanded if mouse moves off of scrollbar while dragging (Closed)
Patch Set: style Created 4 years, 3 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') | ui/events/blink/input_handler_proxy.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 36607354a0fdac4acf0e775d41c133fe15693dec..05bca612c5e074cdb90a284f098ea2d502d7d174 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -209,6 +209,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
wheel_scrolling_(false),
scroll_affects_scroll_handler_(false),
scroll_layer_id_when_mouse_over_scrollbar_(Layer::INVALID_ID),
+ captured_scrollbar_layer_id_(Layer::INVALID_ID),
tile_priorities_dirty_(false),
settings_(settings),
visible_(false),
@@ -3228,6 +3229,28 @@ float LayerTreeHostImpl::DeviceSpaceDistanceToLayer(
device_viewport_point);
}
+void LayerTreeHostImpl::MouseDown() {
+ if (scroll_layer_id_when_mouse_over_scrollbar_ == Layer::INVALID_ID)
+ return;
+
+ captured_scrollbar_layer_id_ = scroll_layer_id_when_mouse_over_scrollbar_;
+ ScrollbarAnimationController* animation_controller =
+ ScrollbarAnimationControllerForId(captured_scrollbar_layer_id_);
+ if (animation_controller)
+ animation_controller->DidCaptureScrollbarBegin();
+}
+
+void LayerTreeHostImpl::MouseUp() {
+ if (captured_scrollbar_layer_id_ == Layer::INVALID_ID)
+ return;
+
+ ScrollbarAnimationController* animation_controller =
+ ScrollbarAnimationControllerForId(captured_scrollbar_layer_id_);
+ if (animation_controller)
+ animation_controller->DidCaptureScrollbarEnd();
+ captured_scrollbar_layer_id_ = Layer::INVALID_ID;
+}
+
void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
gfx::PointF device_viewport_point = gfx::ScalePoint(
gfx::PointF(viewport_point), active_tree_->device_scale_factor());
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | ui/events/blink/input_handler_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698