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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2622103002: Generalize browser controls adjustment for arbitrary scrollers. (Closed)
Patch Set: Fixed some comments Created 3 years, 11 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
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 20aa9f46aa577f6803618959df897b0057191936..755a342454d2de44cb7ce9ddd738a61199f8ce70 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -173,7 +173,6 @@ FrameView::FrameView(LocalFrame& frame)
m_inputEventsScaleFactorForEmulation(1),
m_layoutSizeFixedToFrameSize(true),
m_didScrollTimer(this, &FrameView::didScrollTimerFired),
- m_browserControlsViewportAdjustment(0),
m_needsUpdateWidgetGeometries(false),
#if ENABLE(ASSERT)
m_hasBeenDisposed(false),
@@ -3654,10 +3653,6 @@ void FrameView::didAddScrollbar(Scrollbar& scrollbar,
ScrollableArea::didAddScrollbar(scrollbar, orientation);
}
-void FrameView::setBrowserControlsViewportAdjustment(float adjustment) {
- m_browserControlsViewportAdjustment = adjustment;
-}
-
PaintLayer* FrameView::layer() const {
LayoutViewItem layoutView = layoutViewItem();
if (layoutView.isNull() || !layoutView.compositor())
@@ -3670,9 +3665,23 @@ IntSize FrameView::maximumScrollOffsetInt() const {
// Make the same calculation as in CC's LayerImpl::MaxScrollOffset()
// FIXME: We probably shouldn't be storing the bounds in a float.
// crbug.com/422331.
- IntSize visibleSize =
- visibleContentSize(ExcludeScrollbars) + browserControlsSize();
+ IntSize visibleSize = visibleContentSize(ExcludeScrollbars);
IntSize contentBounds = contentsSize();
+
+ FrameHost* host = m_frame->host();
+ DCHECK(host);
+
+ // We need to perform this const_cast since maximumScrollOffsetInt is a const
+ // method but we can't make layoutViewportScrollableArea const since it can
+ // return |this|. Once root-layer-scrolls ships layoutViewportScrollableArea
+ // can be made const.
+ const ScrollableArea* layoutViewport =
+ const_cast<FrameView*>(this)->layoutViewportScrollableArea();
+ TopDocumentRootScrollerController& controller =
+ host->globalRootScrollerController();
+ if (layoutViewport == controller.rootScrollerArea())
+ visibleSize = controller.rootScrollerVisibleArea();
+
IntSize maximumOffset =
toIntSize(-scrollOrigin() + (contentBounds - visibleSize));
return maximumOffset.expandedTo(minimumScrollOffsetInt());
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/frame/VisualViewport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698