Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp

Issue 2732363003: Make TopDocumentRootScrollerController store Page instead of FrameHost (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
index 412c44bd00f439e92818011b3310f3a657b1e176..bbf4c31f784cec2fb31c2d1dee55b2d10496147a 100644
--- a/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp
@@ -25,18 +25,17 @@ namespace blink {
// static
TopDocumentRootScrollerController* TopDocumentRootScrollerController::create(
- FrameHost& host) {
- return new TopDocumentRootScrollerController(host);
+ Page& page) {
+ return new TopDocumentRootScrollerController(page);
}
-TopDocumentRootScrollerController::TopDocumentRootScrollerController(
- FrameHost& host)
- : m_frameHost(&host) {}
+TopDocumentRootScrollerController::TopDocumentRootScrollerController(Page& page)
+ : m_page(&page) {}
DEFINE_TRACE(TopDocumentRootScrollerController) {
visitor->trace(m_viewportApplyScroll);
visitor->trace(m_globalRootScroller);
- visitor->trace(m_frameHost);
+ visitor->trace(m_page);
}
void TopDocumentRootScrollerController::didChangeRootScroller() {
@@ -70,10 +69,12 @@ IntSize TopDocumentRootScrollerController::rootScrollerVisibleArea() const {
if (!topDocument() || !topDocument()->view())
return IntSize();
- float minimumPageScale =
- m_frameHost->pageScaleConstraintsSet().finalConstraints().minimumScale;
+ float minimumPageScale = m_page->frameHost()
+ .pageScaleConstraintsSet()
+ .finalConstraints()
+ .minimumScale;
int browserControlsAdjustment =
- ceilf(m_frameHost->visualViewport().browserControlsAdjustment() /
+ ceilf(m_page->frameHost().visualViewport().browserControlsAdjustment() /
minimumPageScale);
return topDocument()->view()->visibleContentSize(ExcludeScrollbars) +
@@ -166,14 +167,14 @@ void TopDocumentRootScrollerController::recomputeGlobalRootScroller() {
}
Document* TopDocumentRootScrollerController::topDocument() const {
- if (!m_frameHost)
+ if (!m_page)
return nullptr;
- if (!m_frameHost->page().mainFrame() ||
- !m_frameHost->page().mainFrame()->isLocalFrame())
+ if (!m_page->frameHost().page().mainFrame() ||
+ !m_page->frameHost().page().mainFrame()->isLocalFrame())
return nullptr;
- return toLocalFrame(m_frameHost->page().mainFrame())->document();
+ return toLocalFrame(m_page->frameHost().page().mainFrame())->document();
joelhockey 2017/03/08 04:36:00 I think these references of m_page->frameHost.page
sashab 2017/03/08 05:02:37 Oh yeah, great catch! Fixed here and below, thanks
}
void TopDocumentRootScrollerController::
@@ -194,11 +195,11 @@ void TopDocumentRootScrollerController::
}
void TopDocumentRootScrollerController::didUpdateCompositing() {
- if (!m_frameHost)
+ if (!m_page)
return;
// Let the compositor-side counterpart know about this change.
- m_frameHost->page().chromeClient().registerViewportLayers();
+ m_page->frameHost().page().chromeClient().registerViewportLayers();
}
void TopDocumentRootScrollerController::didDisposeScrollableArea(
@@ -223,10 +224,10 @@ void TopDocumentRootScrollerController::didDisposeScrollableArea(
void TopDocumentRootScrollerController::initializeViewportScrollCallback(
RootFrameViewport& rootFrameViewport) {
- DCHECK(m_frameHost);
+ DCHECK(m_page);
m_viewportApplyScroll = ViewportScrollCallback::create(
- &m_frameHost->browserControls(), &m_frameHost->overscrollController(),
- rootFrameViewport);
+ &m_page->frameHost().browserControls(),
+ &m_page->frameHost().overscrollController(), rootFrameViewport);
recomputeGlobalRootScroller();
}
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698