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 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 // document and restore it when the object goes out of scope. It's | 1839 // document and restore it when the object goes out of scope. It's |
1840 // needed since the browser controls adjustment will change the maximum | 1840 // needed since the browser controls adjustment will change the maximum |
1841 // scroll offset and we may need to reposition them to keep the user's | 1841 // scroll offset and we may need to reposition them to keep the user's |
1842 // apparent position unchanged. | 1842 // apparent position unchanged. |
1843 ResizeViewportAnchor::ResizeScope resizeScope(*m_resizeViewportAnchor); | 1843 ResizeViewportAnchor::ResizeScope resizeScope(*m_resizeViewportAnchor); |
1844 | 1844 |
1845 float browserControlsViewportAdjustment = | 1845 float browserControlsViewportAdjustment = |
1846 browserControls().layoutHeight() - browserControls().contentOffset(); | 1846 browserControls().layoutHeight() - browserControls().contentOffset(); |
1847 visualViewport.setBrowserControlsAdjustment( | 1847 visualViewport.setBrowserControlsAdjustment( |
1848 browserControlsViewportAdjustment); | 1848 browserControlsViewportAdjustment); |
1849 | |
1850 // Since the FrameView is sized to be the visual viewport at minimum | |
1851 // scale, its adjustment must also be scaled by the minimum scale. | |
1852 view->setBrowserControlsViewportAdjustment( | |
1853 browserControlsViewportAdjustment / minimumPageScaleFactor()); | |
1854 } | 1849 } |
1855 } | 1850 } |
1856 | 1851 |
1857 BrowserControls& WebViewImpl::browserControls() { | 1852 BrowserControls& WebViewImpl::browserControls() { |
1858 return page()->frameHost().browserControls(); | 1853 return page()->frameHost().browserControls(); |
1859 } | 1854 } |
1860 | 1855 |
1861 void WebViewImpl::resizeViewWhileAnchored(float browserControlsHeight, | 1856 void WebViewImpl::resizeViewWhileAnchored(float browserControlsHeight, |
1862 bool browserControlsShrinkLayout) { | 1857 bool browserControlsShrinkLayout) { |
1863 DCHECK(mainFrameImpl()); | 1858 DCHECK(mainFrameImpl()); |
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4195 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4190 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
4196 return nullptr; | 4191 return nullptr; |
4197 return focusedFrame; | 4192 return focusedFrame; |
4198 } | 4193 } |
4199 | 4194 |
4200 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4195 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
4201 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4196 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
4202 } | 4197 } |
4203 | 4198 |
4204 } // namespace blink | 4199 } // namespace blink |
OLD | NEW |