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 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2995 bool is_viewport_scroll_layer = | 2995 bool is_viewport_scroll_layer = |
2996 viewport()->MainScrollLayer() && | 2996 viewport()->MainScrollLayer() && |
2997 scroll_node->owning_layer_id == viewport()->MainScrollLayer()->id(); | 2997 scroll_node->owning_layer_id == viewport()->MainScrollLayer()->id(); |
2998 | 2998 |
2999 // This is needed if the scroll chains up to the viewport without going | 2999 // This is needed if the scroll chains up to the viewport without going |
3000 // through the outer viewport scroll layer. This can happen if we scroll an | 3000 // through the outer viewport scroll layer. This can happen if we scroll an |
3001 // element that's not a descendant of the document.rootScroller. In that case | 3001 // element that's not a descendant of the document.rootScroller. In that case |
3002 // we want to scroll the inner viewport -- to allow panning while zoomed -- | 3002 // we want to scroll the inner viewport -- to allow panning while zoomed -- |
3003 // but also move browser controls if needed. | 3003 // but also move browser controls if needed. |
3004 bool is_inner_viewport_scroll_layer = | 3004 bool is_inner_viewport_scroll_layer = |
| 3005 InnerViewportScrollLayer() && |
3005 scroll_node->owning_layer_id == InnerViewportScrollLayer()->id(); | 3006 scroll_node->owning_layer_id == InnerViewportScrollLayer()->id(); |
3006 | 3007 |
3007 if (is_viewport_scroll_layer || is_inner_viewport_scroll_layer) { | 3008 if (is_viewport_scroll_layer || is_inner_viewport_scroll_layer) { |
3008 Viewport::ScrollResult result = viewport()->ScrollBy( | 3009 Viewport::ScrollResult result = viewport()->ScrollBy( |
3009 delta, viewport_point, scroll_state->is_direct_manipulation(), | 3010 delta, viewport_point, scroll_state->is_direct_manipulation(), |
3010 !wheel_scrolling_, is_viewport_scroll_layer); | 3011 !wheel_scrolling_, is_viewport_scroll_layer); |
3011 | 3012 |
3012 applied_delta = result.consumed_delta; | 3013 applied_delta = result.consumed_delta; |
3013 delta_applied_to_content = result.content_scrolled_delta; | 3014 delta_applied_to_content = result.content_scrolled_delta; |
3014 } else { | 3015 } else { |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4093 worker_context_visibility_ = | 4094 worker_context_visibility_ = |
4094 worker_context->CacheController()->ClientBecameVisible(); | 4095 worker_context->CacheController()->ClientBecameVisible(); |
4095 } else { | 4096 } else { |
4096 worker_context->CacheController()->ClientBecameNotVisible( | 4097 worker_context->CacheController()->ClientBecameNotVisible( |
4097 std::move(worker_context_visibility_)); | 4098 std::move(worker_context_visibility_)); |
4098 } | 4099 } |
4099 } | 4100 } |
4100 } | 4101 } |
4101 | 4102 |
4102 } // namespace cc | 4103 } // namespace cc |
OLD | NEW |