| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const { | 65 ScrollableArea* TopDocumentRootScrollerController::rootScrollerArea() const { |
| 66 return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller()); | 66 return RootScrollerUtil::scrollableAreaForRootScroller(globalRootScroller()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const { | 69 IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const { |
| 70 if (!topDocument() || !topDocument()->view()) | 70 if (!topDocument() || !topDocument()->view()) |
| 71 return IntSize(); | 71 return IntSize(); |
| 72 | 72 |
| 73 float minimumPageScale = | 73 float minimumPageScale = m_frameHost->page() |
| 74 m_frameHost->pageScaleConstraintsSet().finalConstraints().minimumScale; | 74 .pageScaleConstraintsSet() |
| 75 .finalConstraints() |
| 76 .minimumScale; |
| 75 int browserControlsAdjustment = | 77 int browserControlsAdjustment = |
| 76 ceilf(m_frameHost->visualViewport().browserControlsAdjustment() / | 78 ceilf(m_frameHost->visualViewport().browserControlsAdjustment() / |
| 77 minimumPageScale); | 79 minimumPageScale); |
| 78 | 80 |
| 79 return topDocument()->view()->visibleContentSize(ExcludeScrollbars) + | 81 return topDocument()->view()->visibleContentSize(ExcludeScrollbars) + |
| 80 IntSize(0, browserControlsAdjustment); | 82 IntSize(0, browserControlsAdjustment); |
| 81 } | 83 } |
| 82 | 84 |
| 83 Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() { | 85 Element* TopDocumentRootScrollerController::findGlobalRootScrollerElement() { |
| 84 if (!topDocument()) | 86 if (!topDocument()) |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 259 |
| 258 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { | 260 PaintLayer* TopDocumentRootScrollerController::rootScrollerPaintLayer() const { |
| 259 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); | 261 return RootScrollerUtil::paintLayerForRootScroller(m_globalRootScroller); |
| 260 } | 262 } |
| 261 | 263 |
| 262 Element* TopDocumentRootScrollerController::globalRootScroller() const { | 264 Element* TopDocumentRootScrollerController::globalRootScroller() const { |
| 263 return m_globalRootScroller.get(); | 265 return m_globalRootScroller.get(); |
| 264 } | 266 } |
| 265 | 267 |
| 266 } // namespace blink | 268 } // namespace blink |
| OLD | NEW |