| OLD | NEW |
| 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 Loading... |
| 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 | |
| 3282 void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) { | 3275 void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) { |
| 3283 int new_id = Layer::INVALID_ID; | 3276 int new_id = Layer::INVALID_ID; |
| 3284 if (layer_impl && layer_impl->ToScrollbarLayer()) | 3277 if (layer_impl && layer_impl->ToScrollbarLayer()) |
| 3285 new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId(); | 3278 new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId(); |
| 3286 | 3279 |
| 3287 if (new_id == scroll_layer_id_when_mouse_over_scrollbar_) | 3280 if (new_id == scroll_layer_id_when_mouse_over_scrollbar_) |
| 3288 return; | 3281 return; |
| 3289 | 3282 |
| 3290 ScrollbarAnimationController* old_animation_controller = | 3283 ScrollbarAnimationController* old_animation_controller = |
| 3291 ScrollbarAnimationControllerForId( | 3284 ScrollbarAnimationControllerForId( |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4095 if (is_visible) { | 4088 if (is_visible) { |
| 4096 worker_context_visibility_ = | 4089 worker_context_visibility_ = |
| 4097 worker_context->CacheController()->ClientBecameVisible(); | 4090 worker_context->CacheController()->ClientBecameVisible(); |
| 4098 } else { | 4091 } else { |
| 4099 worker_context->CacheController()->ClientBecameNotVisible( | 4092 worker_context->CacheController()->ClientBecameNotVisible( |
| 4100 std::move(worker_context_visibility_)); | 4093 std::move(worker_context_visibility_)); |
| 4101 } | 4094 } |
| 4102 } | 4095 } |
| 4103 | 4096 |
| 4104 } // namespace cc | 4097 } // namespace cc |
| OLD | NEW |