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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2737703002: Remove FrameHost::browserControls() (Closed)
Patch Set: Rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 float zoom = frame().pageZoomFactor(); 1408 float zoom = frame().pageZoomFactor();
1409 1409
1410 LayoutViewItem layoutViewItem = this->layoutViewItem(); 1410 LayoutViewItem layoutViewItem = this->layoutViewItem();
1411 if (layoutViewItem.isNull()) 1411 if (layoutViewItem.isNull())
1412 return FloatSize(); 1412 return FloatSize();
1413 1413
1414 FloatSize layoutSize; 1414 FloatSize layoutSize;
1415 layoutSize.setWidth(layoutViewItem.viewWidth(IncludeScrollbars) / zoom); 1415 layoutSize.setWidth(layoutViewItem.viewWidth(IncludeScrollbars) / zoom);
1416 layoutSize.setHeight(layoutViewItem.viewHeight(IncludeScrollbars) / zoom); 1416 layoutSize.setHeight(layoutViewItem.viewHeight(IncludeScrollbars) / zoom);
1417 1417
1418 BrowserControls& browserControls = m_frame->host()->browserControls(); 1418 BrowserControls& browserControls = m_frame->page()->browserControls();
1419 if (RuntimeEnabledFeatures::inertTopControlsEnabled() && 1419 if (RuntimeEnabledFeatures::inertTopControlsEnabled() &&
1420 browserControls.permittedState() != WebBrowserControlsHidden) { 1420 browserControls.permittedState() != WebBrowserControlsHidden) {
1421 // We use the layoutSize rather than frameRect to calculate viewport units 1421 // We use the layoutSize rather than frameRect to calculate viewport units
1422 // so that we get correct results on mobile where the page is laid out into 1422 // so that we get correct results on mobile where the page is laid out into
1423 // a rect that may be larger than the viewport (e.g. the 980px fallback 1423 // a rect that may be larger than the viewport (e.g. the 980px fallback
1424 // width for desktop pages). Since the layout height is statically set to 1424 // width for desktop pages). Since the layout height is statically set to
1425 // be the viewport with browser controls showing, we add the browser 1425 // be the viewport with browser controls showing, we add the browser
1426 // controls height, compensating for page scale as well, since we want to 1426 // controls height, compensating for page scale as well, since we want to
1427 // use the viewport with browser controls hidden for vh (to match Safari). 1427 // use the viewport with browser controls hidden for vh (to match Safari).
1428 int viewportWidth = m_frame->host()->visualViewport().size().width(); 1428 int viewportWidth = m_frame->host()->visualViewport().size().width();
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 // to issue the invalidation). This is because the background fills the 1639 // to issue the invalidation). This is because the background fills the
1640 // main GraphicsLayer, which takes the size of the layout viewport. 1640 // main GraphicsLayer, which takes the size of the layout viewport.
1641 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents 1641 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents
1642 // layer and avoid this invalidation (http://crbug.com/568847). 1642 // layer and avoid this invalidation (http://crbug.com/568847).
1643 LayoutViewItem lvi = layoutViewItem(); 1643 LayoutViewItem lvi = layoutViewItem();
1644 if (!lvi.isNull()) 1644 if (!lvi.isNull())
1645 lvi.setShouldDoFullPaintInvalidation(); 1645 lvi.setShouldDoFullPaintInvalidation();
1646 } 1646 }
1647 1647
1648 if (RuntimeEnabledFeatures::inertTopControlsEnabled() && layoutView() && 1648 if (RuntimeEnabledFeatures::inertTopControlsEnabled() && layoutView() &&
1649 m_frame->isMainFrame() && m_frame->host()->browserControls().height()) { 1649 m_frame->isMainFrame() && m_frame->page()->browserControls().height()) {
1650 if (layoutView()->style()->hasFixedBackgroundImage()) { 1650 if (layoutView()->style()->hasFixedBackgroundImage()) {
1651 // In the case where we don't change layout size from top control resizes, 1651 // In the case where we don't change layout size from top control resizes,
1652 // we wont perform a layout. If we have a fixed background image however, 1652 // we wont perform a layout. If we have a fixed background image however,
1653 // the background layer needs to get resized so we should request a layout 1653 // the background layer needs to get resized so we should request a layout
1654 // explicitly. 1654 // explicitly.
1655 PaintLayer* layer = layoutView()->layer(); 1655 PaintLayer* layer = layoutView()->layer();
1656 if (layoutView()->compositor()->needsFixedRootBackgroundLayer(layer)) { 1656 if (layoutView()->compositor()->needsFixedRootBackgroundLayer(layer)) {
1657 setNeedsLayout(); 1657 setNeedsLayout();
1658 } else if (!rootLayerScrollingEnabled) { 1658 } else if (!rootLayerScrollingEnabled) {
1659 // If root layer scrolls is on, we've already issued a full invalidation 1659 // If root layer scrolls is on, we've already issued a full invalidation
(...skipping 3593 matching lines...) Expand 10 before | Expand all | Expand 10 after
5253 void FrameView::setAnimationHost( 5253 void FrameView::setAnimationHost(
5254 std::unique_ptr<CompositorAnimationHost> host) { 5254 std::unique_ptr<CompositorAnimationHost> host) {
5255 m_animationHost = std::move(host); 5255 m_animationHost = std::move(host);
5256 } 5256 }
5257 5257
5258 LayoutUnit FrameView::caretWidth() const { 5258 LayoutUnit FrameView::caretWidth() const {
5259 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5259 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5260 } 5260 }
5261 5261
5262 } // namespace blink 5262 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/scrolling/TopDocumentRootScrollerController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698