| 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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 } | 943 } |
| 944 | 944 |
| 945 WebLocalFrameImpl* WebViewImpl::localFrameRootTemporary() const | 945 WebLocalFrameImpl* WebViewImpl::localFrameRootTemporary() const |
| 946 { | 946 { |
| 947 // FIXME(sky): remove | 947 // FIXME(sky): remove |
| 948 return WebLocalFrameImpl::fromFrame(page()->mainFrame()); | 948 return WebLocalFrameImpl::fromFrame(page()->mainFrame()); |
| 949 } | 949 } |
| 950 | 950 |
| 951 void WebViewImpl::performResize() | 951 void WebViewImpl::performResize() |
| 952 { | 952 { |
| 953 updatePageDefinedViewportConstraints(localFrameRootTemporary()->frame()->doc
ument()->viewportDescription()); | |
| 954 updateMainFrameLayoutSize(); | 953 updateMainFrameLayoutSize(); |
| 955 | 954 |
| 956 // If the virtual viewport pinch mode is enabled, the main frame will be res
ized | 955 // If the virtual viewport pinch mode is enabled, the main frame will be res
ized |
| 957 // after layout so it can be sized to the contentsSize. | 956 // after layout so it can be sized to the contentsSize. |
| 958 if (localFrameRootTemporary()->frameView()) | 957 if (localFrameRootTemporary()->frameView()) |
| 959 localFrameRootTemporary()->frameView()->resize(m_size); | 958 localFrameRootTemporary()->frameView()->resize(m_size); |
| 960 } | 959 } |
| 961 | 960 |
| 962 void WebViewImpl::resize(const WebSize& newSize) | 961 void WebViewImpl::resize(const WebSize& newSize) |
| 963 { | 962 { |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1823 { | 1822 { |
| 1824 if (!page()) | 1823 if (!page()) |
| 1825 return; | 1824 return; |
| 1826 | 1825 |
| 1827 page()->setDeviceScaleFactor(scaleFactor); | 1826 page()->setDeviceScaleFactor(scaleFactor); |
| 1828 | 1827 |
| 1829 if (m_layerTreeView) | 1828 if (m_layerTreeView) |
| 1830 updateLayerTreeDeviceScaleFactor(); | 1829 updateLayerTreeDeviceScaleFactor(); |
| 1831 } | 1830 } |
| 1832 | 1831 |
| 1833 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) | |
| 1834 { | |
| 1835 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h
eight)) | |
| 1836 return; | |
| 1837 | |
| 1838 Document* document = page()->mainFrame()->document(); | |
| 1839 | |
| 1840 m_matchesHeuristicsForGpuRasterization = description.maxWidth == Length(Devi
ceWidth) | |
| 1841 && description.minZoom == 1.0 | |
| 1842 && description.minZoomIsExplicit; | |
| 1843 if (m_layerTreeView) | |
| 1844 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic
sForGpuRasterization); | |
| 1845 | |
| 1846 Length defaultMinWidth = document->viewportDefaultMinWidth(); | |
| 1847 if (defaultMinWidth.isAuto()) | |
| 1848 defaultMinWidth = Length(ExtendToZoom); | |
| 1849 | |
| 1850 updateMainFrameLayoutSize(); | |
| 1851 } | |
| 1852 | |
| 1853 void WebViewImpl::updateMainFrameLayoutSize() | 1832 void WebViewImpl::updateMainFrameLayoutSize() |
| 1854 { | 1833 { |
| 1855 if (m_fixedLayoutSizeLock || !mainFrameImpl()) | 1834 if (m_fixedLayoutSizeLock || !mainFrameImpl()) |
| 1856 return; | 1835 return; |
| 1857 | 1836 |
| 1858 RefPtr<FrameView> view = mainFrameImpl()->frameView(); | 1837 RefPtr<FrameView> view = mainFrameImpl()->frameView(); |
| 1859 if (!view) | 1838 if (!view) |
| 1860 return; | 1839 return; |
| 1861 | 1840 |
| 1862 WebSize layoutSize = m_size; | 1841 WebSize layoutSize = m_size; |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2462 m_layerTreeView->setVisible(visible); | 2441 m_layerTreeView->setVisible(visible); |
| 2463 } | 2442 } |
| 2464 } | 2443 } |
| 2465 | 2444 |
| 2466 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 2445 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 2467 { | 2446 { |
| 2468 return true; | 2447 return true; |
| 2469 } | 2448 } |
| 2470 | 2449 |
| 2471 } // namespace blink | 2450 } // namespace blink |
| OLD | NEW |