| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (LayoutView* view = m_globalRootScroller->document().layoutView()) { | 191 if (LayoutView* view = m_globalRootScroller->document().layoutView()) { |
| 192 view->compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); | 192 view->compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| 196 void TopDocumentRootScrollerController::didUpdateCompositing() { | 196 void TopDocumentRootScrollerController::didUpdateCompositing() { |
| 197 if (!m_frameHost) | 197 if (!m_frameHost) |
| 198 return; | 198 return; |
| 199 | 199 |
| 200 // Let the compositor-side counterpart know about this change. | 200 // Let the compositor-side counterpart know about this change. |
| 201 m_frameHost->chromeClient().registerViewportLayers(); | 201 m_frameHost->page().chromeClient().registerViewportLayers(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void TopDocumentRootScrollerController::didDisposeScrollableArea( | 204 void TopDocumentRootScrollerController::didDisposeScrollableArea( |
| 205 ScrollableArea& area) { | 205 ScrollableArea& area) { |
| 206 if (!topDocument() || !topDocument()->view()) | 206 if (!topDocument() || !topDocument()->view()) |
| 207 return; | 207 return; |
| 208 | 208 |
| 209 // If the document is tearing down, we may no longer have a layoutViewport to | 209 // If the document is tearing down, we may no longer have a layoutViewport to |
| 210 // fallback to. | 210 // fallback to. |
| 211 if (topDocument()->lifecycle().state() >= DocumentLifecycle::Stopping) | 211 if (topDocument()->lifecycle().state() >= DocumentLifecycle::Stopping) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { | 258 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { |
| 259 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); | 259 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); |
| 260 } | 260 } |
| 261 | 261 |
| 262 Element* TopDocumentRootScrollerController::globalRootScroller() const { | 262 Element* TopDocumentRootScrollerController::globalRootScroller() const { |
| 263 return m_globalRootScroller.get(); | 263 return m_globalRootScroller.get(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace blink | 266 } // namespace blink |
| OLD | NEW |