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

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

Issue 2384053002: cancel overlay-scrollbar hover state when moving pointer out of window for ChromeOS (Closed)
Patch Set: quick return Created 4 years, 2 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 | « cc/trees/layer_tree_host_impl.h ('k') | ui/events/blink/input_handler_proxy.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 3254 matching lines...) Expand 10 before | Expand all | Expand 10 after
3265 for (ScrollbarLayerImplBase* scrollbar : 3265 for (ScrollbarLayerImplBase* scrollbar :
3266 ScrollbarsFor(scroll_layer_impl->id())) 3266 ScrollbarsFor(scroll_layer_impl->id()))
3267 distance_to_scrollbar = 3267 distance_to_scrollbar =
3268 std::min(distance_to_scrollbar, 3268 std::min(distance_to_scrollbar,
3269 DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar)); 3269 DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar));
3270 3270
3271 animation_controller->DidMouseMoveNear(distance_to_scrollbar / 3271 animation_controller->DidMouseMoveNear(distance_to_scrollbar /
3272 active_tree_->device_scale_factor()); 3272 active_tree_->device_scale_factor());
3273 } 3273 }
3274 3274
3275 void LayerTreeHostImpl::MouseLeave() {
3276 for (auto& pair : scrollbar_animation_controllers_)
3277 pair.second->DidMouseMoveOffScrollbar();
3278
3279 scroll_layer_id_when_mouse_over_scrollbar_ = Layer::INVALID_ID;
3280 }
3281
3275 void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) { 3282 void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) {
3276 int new_id = Layer::INVALID_ID; 3283 int new_id = Layer::INVALID_ID;
3277 if (layer_impl && layer_impl->ToScrollbarLayer()) 3284 if (layer_impl && layer_impl->ToScrollbarLayer())
3278 new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId(); 3285 new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId();
3279 3286
3280 if (new_id == scroll_layer_id_when_mouse_over_scrollbar_) 3287 if (new_id == scroll_layer_id_when_mouse_over_scrollbar_)
3281 return; 3288 return;
3282 3289
3283 ScrollbarAnimationController* old_animation_controller = 3290 ScrollbarAnimationController* old_animation_controller =
3284 ScrollbarAnimationControllerForId( 3291 ScrollbarAnimationControllerForId(
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
4088 if (is_visible) { 4095 if (is_visible) {
4089 worker_context_visibility_ = 4096 worker_context_visibility_ =
4090 worker_context->CacheController()->ClientBecameVisible(); 4097 worker_context->CacheController()->ClientBecameVisible();
4091 } else { 4098 } else {
4092 worker_context->CacheController()->ClientBecameNotVisible( 4099 worker_context->CacheController()->ClientBecameNotVisible(
4093 std::move(worker_context_visibility_)); 4100 std::move(worker_context_visibility_));
4094 } 4101 }
4095 } 4102 }
4096 4103
4097 } // namespace cc 4104 } // namespace cc
OLDNEW
« 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