OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1705 } | 1705 } |
1706 | 1706 |
1707 void WebViewImpl::setTopControlsLayoutHeight(float height) | 1707 void WebViewImpl::setTopControlsLayoutHeight(float height) |
1708 { | 1708 { |
1709 m_topControlsLayoutHeight = height; | 1709 m_topControlsLayoutHeight = height; |
1710 didUpdateTopControls(); | 1710 didUpdateTopControls(); |
1711 } | 1711 } |
1712 | 1712 |
1713 void WebViewImpl::didUpdateTopControls() | 1713 void WebViewImpl::didUpdateTopControls() |
1714 { | 1714 { |
1715 FrameView* view = localFrameRootTemporary()->frameView(); | 1715 WebLocalFrameImpl* localFrameRoot = localFrameRootTemporary(); |
1716 if (!localFrameRoot) | |
1717 return; | |
1718 | |
1719 FrameView* view = localFrameRoot->frameView(); | |
1716 if (!view) | 1720 if (!view) |
1717 return; | 1721 return; |
1718 | 1722 |
1719 // The viewport bounds were adjusted on the compositor by this much due to t op controls. Tell | 1723 // The viewport bounds were adjusted on the compositor by this much due to t op controls. Tell |
1720 // the FrameView about it so it can make correct scroll offset clamping deci sions during compositor | 1724 // the FrameView about it so it can make correct scroll offset clamping deci sions during compositor |
1721 // commits. | 1725 // commits. |
1722 // FIXME(bokan) Reenable once Chromium side lands. | 1726 // FIXME(bokan) Reenable once Chromium side lands. |
1723 // float topControlsViewportAdjustment = m_topControlsContentOffset - m_topC ontrolsLayoutHeight; | 1727 // float topControlsViewportAdjustment = m_topControlsContentOffset - m_topC ontrolsLayoutHeight; |
1724 // view->setTopControlsViewportAdjustment(topControlsViewportAdjustment); | 1728 // view->setTopControlsViewportAdjustment(topControlsViewportAdjustment); |
1725 } | 1729 } |
1726 | 1730 |
1727 void WebViewImpl::resize(const WebSize& newSize) | 1731 void WebViewImpl::resize(const WebSize& newSize) |
1728 { | 1732 { |
1729 if (m_shouldAutoResize || m_size == newSize) | 1733 if (m_shouldAutoResize || m_size == newSize) |
1730 return; | 1734 return; |
1731 | 1735 |
1732 FrameView* view = localFrameRootTemporary()->frameView(); | 1736 // FIXME: if a remote frame is swapped back in, it may have the wrong |
1737 // sizing. | |
kenrb
2014/10/10 19:20:21
I don't think this is a valid concern. Size messag
| |
1738 WebLocalFrameImpl* localFrameRoot = localFrameRootTemporary(); | |
1739 if (!localFrameRoot) | |
1740 return; | |
1741 | |
1742 FrameView* view = localFrameRoot->frameView(); | |
1733 if (!view) | 1743 if (!view) |
1734 return; | 1744 return; |
1735 | 1745 |
1736 bool shouldAnchorAndRescaleViewport = settings()->mainFrameResizesAreOrienta tionChanges() | 1746 bool shouldAnchorAndRescaleViewport = settings()->mainFrameResizesAreOrienta tionChanges() |
1737 && m_size.width && contentsSize().width() && newSize.width != m_size.wid th && !m_fullscreenController->isFullscreen(); | 1747 && m_size.width && contentsSize().width() && newSize.width != m_size.wid th && !m_fullscreenController->isFullscreen(); |
1738 float oldPageScaleFactor = pageScaleFactor(); | 1748 float oldPageScaleFactor = pageScaleFactor(); |
1739 float oldMinimumPageScaleFactor = minimumPageScaleFactor(); | 1749 float oldMinimumPageScaleFactor = minimumPageScaleFactor(); |
1740 | 1750 |
1741 m_size = newSize; | 1751 m_size = newSize; |
1742 | 1752 |
(...skipping 2695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4438 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); | 4448 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); |
4439 | 4449 |
4440 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4450 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4441 return false; | 4451 return false; |
4442 | 4452 |
4443 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4453 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4444 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4454 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
4445 } | 4455 } |
4446 | 4456 |
4447 } // namespace blink | 4457 } // namespace blink |
OLD | NEW |