OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/page/scrolling/TopDocumentRootScrollerController.h" | 5 #include "core/page/scrolling/TopDocumentRootScrollerController.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
9 #include "core/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
10 #include "core/frame/FrameView.h" | 10 #include "core/frame/FrameView.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Ideally, scroll customization would pass the current element to scroll to | 87 // Ideally, scroll customization would pass the current element to scroll to |
88 // the apply scroll callback but this doesn't happen today so we set it | 88 // the apply scroll callback but this doesn't happen today so we set it |
89 // through a back door here. This is also needed by the | 89 // through a back door here. This is also needed by the |
90 // ViewportScrollCallback to swap the target into the layout viewport | 90 // ViewportScrollCallback to swap the target into the layout viewport |
91 // in RootFrameViewport. | 91 // in RootFrameViewport. |
92 m_viewportApplyScroll->setScroller(targetScroller); | 92 m_viewportApplyScroll->setScroller(targetScroller); |
93 } | 93 } |
94 | 94 |
95 void TopDocumentRootScrollerController::didUpdateCompositing() | 95 void TopDocumentRootScrollerController::didUpdateCompositing() |
96 { | 96 { |
97 FrameHost* frameHost = m_document->frameHost(); | 97 RootScrollerController::didUpdateCompositing(); |
98 | 98 |
99 // Let the compositor-side counterpart know about this change. | 99 // Let the compositor-side counterpart know about this change. |
100 if (frameHost) | 100 if (FrameHost* frameHost = m_document->frameHost()) |
101 frameHost->chromeClient().registerViewportLayers(); | 101 frameHost->chromeClient().registerViewportLayers(); |
102 } | 102 } |
103 | 103 |
104 void TopDocumentRootScrollerController::didAttachDocument() | 104 void TopDocumentRootScrollerController::didAttachDocument() |
105 { | 105 { |
106 FrameHost* frameHost = m_document->frameHost(); | 106 FrameHost* frameHost = m_document->frameHost(); |
107 FrameView* frameView = m_document->view(); | 107 FrameView* frameView = m_document->view(); |
108 | 108 |
109 if (!frameHost || !frameView) | 109 if (!frameHost || !frameView) |
110 return; | 110 return; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 GraphicsLayer* graphicsLayer = area->layerForScrolling(); | 142 GraphicsLayer* graphicsLayer = area->layerForScrolling(); |
143 | 143 |
144 // TODO(bokan): We should assert graphicsLayer here and | 144 // TODO(bokan): We should assert graphicsLayer here and |
145 // RootScrollerController should do whatever needs to happen to ensure | 145 // RootScrollerController should do whatever needs to happen to ensure |
146 // the root scroller gets composited. | 146 // the root scroller gets composited. |
147 | 147 |
148 return graphicsLayer; | 148 return graphicsLayer; |
149 } | 149 } |
150 | 150 |
151 } // namespace blink | 151 } // namespace blink |
OLD | NEW |