| 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 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 view->setTopControlsViewportAdjustment(topControlsViewportAdjustment / minim
umPageScaleFactor()); | 1895 view->setTopControlsViewportAdjustment(topControlsViewportAdjustment / minim
umPageScaleFactor()); |
| 1896 } | 1896 } |
| 1897 | 1897 |
| 1898 TopControls& WebViewImpl::topControls() | 1898 TopControls& WebViewImpl::topControls() |
| 1899 { | 1899 { |
| 1900 return page()->frameHost().topControls(); | 1900 return page()->frameHost().topControls(); |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 void WebViewImpl::resizeViewWhileAnchored(FrameView* view) | 1903 void WebViewImpl::resizeViewWhileAnchored(FrameView* view) |
| 1904 { | 1904 { |
| 1905 // FIXME: TextAutosizer does not yet support out-of-process frames. | 1905 ASSERT(mainFrameImpl() && mainFrameImpl()->frame()->isLocalFrame()); |
| 1906 if (mainFrameImpl() && mainFrameImpl()->frame()->isLocalFrame()) { | 1906 |
| 1907 { |
| 1907 // Avoids unnecessary invalidations while various bits of state in TextA
utosizer are updated. | 1908 // Avoids unnecessary invalidations while various bits of state in TextA
utosizer are updated. |
| 1908 TextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page()); | 1909 TextAutosizer::DeferUpdatePageInfo deferUpdatePageInfo(page()); |
| 1909 performResize(); | 1910 performResize(); |
| 1910 } else { | |
| 1911 performResize(); | |
| 1912 } | 1911 } |
| 1913 | 1912 |
| 1914 m_fullscreenController->updateSize(); | 1913 m_fullscreenController->updateSize(); |
| 1915 | 1914 |
| 1916 // Relayout immediately to recalculate the minimum scale limit for rotation
anchoring. | 1915 // Relayout immediately to recalculate the minimum scale limit for rotation
anchoring. |
| 1917 if (view->needsLayout()) | 1916 if (view->needsLayout()) |
| 1918 view->layout(); | 1917 view->layout(); |
| 1919 } | 1918 } |
| 1920 | 1919 |
| 1921 void WebViewImpl::resize(const WebSize& newSize) | 1920 void WebViewImpl::resize(const WebSize& newSize) |
| 1922 { | 1921 { |
| 1923 if (m_shouldAutoResize || m_size == newSize) | 1922 if (m_shouldAutoResize || m_size == newSize) |
| 1924 return; | 1923 return; |
| 1925 | 1924 |
| 1925 if (page()->mainFrame() && !page()->mainFrame()->isLocalFrame()) { |
| 1926 // Viewport resize for a remote main frame does not require any |
| 1927 // particular action, but the state needs to reflect the correct size |
| 1928 // so that it can be used for initalization if the main frame gets |
| 1929 // swapped to a LocalFrame at a later time. |
| 1930 m_size = newSize; |
| 1931 pageScaleConstraintsSet().didChangeViewSize(m_size); |
| 1932 page()->frameHost().visualViewport().setSize(m_size); |
| 1933 return; |
| 1934 } |
| 1935 |
| 1926 WebLocalFrameImpl* mainFrame = mainFrameImpl(); | 1936 WebLocalFrameImpl* mainFrame = mainFrameImpl(); |
| 1927 if (!mainFrame) | 1937 if (!mainFrame) |
| 1928 return; | 1938 return; |
| 1929 | 1939 |
| 1930 FrameView* view = mainFrame->frameView(); | 1940 FrameView* view = mainFrame->frameView(); |
| 1931 if (!view) | 1941 if (!view) |
| 1932 return; | 1942 return; |
| 1933 | 1943 |
| 1934 VisualViewport& visualViewport = page()->frameHost().visualViewport(); | 1944 VisualViewport& visualViewport = page()->frameHost().visualViewport(); |
| 1935 | 1945 |
| (...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4626 void WebViewImpl::detachPaintArtifactCompositor() | 4636 void WebViewImpl::detachPaintArtifactCompositor() |
| 4627 { | 4637 { |
| 4628 if (!m_layerTreeView) | 4638 if (!m_layerTreeView) |
| 4629 return; | 4639 return; |
| 4630 | 4640 |
| 4631 m_layerTreeView->setDeferCommits(true); | 4641 m_layerTreeView->setDeferCommits(true); |
| 4632 m_layerTreeView->clearRootLayer(); | 4642 m_layerTreeView->clearRootLayer(); |
| 4633 } | 4643 } |
| 4634 | 4644 |
| 4635 } // namespace blink | 4645 } // namespace blink |
| OLD | NEW |