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 3248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3259 for (ScrollbarLayerImplBase* scrollbar : | 3259 for (ScrollbarLayerImplBase* scrollbar : |
3260 ScrollbarsFor(scroll_layer_impl->id())) | 3260 ScrollbarsFor(scroll_layer_impl->id())) |
3261 distance_to_scrollbar = | 3261 distance_to_scrollbar = |
3262 std::min(distance_to_scrollbar, | 3262 std::min(distance_to_scrollbar, |
3263 DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar)); | 3263 DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar)); |
3264 | 3264 |
3265 animation_controller->DidMouseMoveNear(distance_to_scrollbar / | 3265 animation_controller->DidMouseMoveNear(distance_to_scrollbar / |
3266 active_tree_->device_scale_factor()); | 3266 active_tree_->device_scale_factor()); |
3267 } | 3267 } |
3268 | 3268 |
3269 void LayerTreeHostImpl::MouseLeave() { | |
3270 ScrollbarAnimationController* animation_controller = | |
bokan
2016/10/04 20:57:41
What if the mouse isn't over the scrollbar though,
chaopeng
2016/10/05 02:29:29
Yes, It doesnot work for near-moveout. I add a new
| |
3271 ScrollbarAnimationControllerForId( | |
3272 scroll_layer_id_when_mouse_over_scrollbar_); | |
3273 | |
3274 if (animation_controller) { | |
dtapuska
2016/10/04 20:50:22
don't think you need the scope brackets :-)
| |
3275 animation_controller->DidMouseLeave(); | |
3276 } | |
3277 } | |
3278 | |
3269 void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) { | 3279 void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) { |
3270 int new_id = Layer::INVALID_ID; | 3280 int new_id = Layer::INVALID_ID; |
3271 if (layer_impl && layer_impl->ToScrollbarLayer()) | 3281 if (layer_impl && layer_impl->ToScrollbarLayer()) |
3272 new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId(); | 3282 new_id = layer_impl->ToScrollbarLayer()->ScrollLayerId(); |
3273 | 3283 |
3274 if (new_id == scroll_layer_id_when_mouse_over_scrollbar_) | 3284 if (new_id == scroll_layer_id_when_mouse_over_scrollbar_) |
3275 return; | 3285 return; |
3276 | 3286 |
3277 ScrollbarAnimationController* old_animation_controller = | 3287 ScrollbarAnimationController* old_animation_controller = |
3278 ScrollbarAnimationControllerForId( | 3288 ScrollbarAnimationControllerForId( |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4165 if (is_visible) { | 4175 if (is_visible) { |
4166 worker_context_visibility_ = | 4176 worker_context_visibility_ = |
4167 worker_context->CacheController()->ClientBecameVisible(); | 4177 worker_context->CacheController()->ClientBecameVisible(); |
4168 } else { | 4178 } else { |
4169 worker_context->CacheController()->ClientBecameNotVisible( | 4179 worker_context->CacheController()->ClientBecameNotVisible( |
4170 std::move(worker_context_visibility_)); | 4180 std::move(worker_context_visibility_)); |
4171 } | 4181 } |
4172 } | 4182 } |
4173 | 4183 |
4174 } // namespace cc | 4184 } // namespace cc |
OLD | NEW |