Chromium Code Reviews| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 #include "AutofillPopupMenuClient.h" | 50 #include "AutofillPopupMenuClient.h" |
| 51 #include "CSSValueKeywords.h" | 51 #include "CSSValueKeywords.h" |
| 52 #include "CompositionUnderlineVectorBuilder.h" | 52 #include "CompositionUnderlineVectorBuilder.h" |
| 53 #include "ContextFeaturesClientImpl.h" | 53 #include "ContextFeaturesClientImpl.h" |
| 54 #include "DeviceOrientationClientProxy.h" | 54 #include "DeviceOrientationClientProxy.h" |
| 55 #include "GeolocationClientProxy.h" | 55 #include "GeolocationClientProxy.h" |
| 56 #include "GraphicsLayerFactoryChromium.h" | 56 #include "GraphicsLayerFactoryChromium.h" |
| 57 #include "HTMLNames.h" | 57 #include "HTMLNames.h" |
| 58 #include "LinkHighlight.h" | 58 #include "LinkHighlight.h" |
| 59 #include "PageWidgetDelegate.h" | 59 #include "PageWidgetDelegate.h" |
| 60 #include "PinchViewports.h" | |
| 60 #include "PopupContainer.h" | 61 #include "PopupContainer.h" |
| 61 #include "PrerendererClientImpl.h" | 62 #include "PrerendererClientImpl.h" |
| 62 #include "SpeechInputClientImpl.h" | 63 #include "SpeechInputClientImpl.h" |
| 63 #include "SpeechRecognitionClientProxy.h" | 64 #include "SpeechRecognitionClientProxy.h" |
| 64 #include "TextFieldDecoratorImpl.h" | 65 #include "TextFieldDecoratorImpl.h" |
| 65 #include "ValidationMessageClientImpl.h" | 66 #include "ValidationMessageClientImpl.h" |
| 66 #include "ViewportAnchor.h" | 67 #include "ViewportAnchor.h" |
| 67 #include "WebAccessibilityObject.h" | 68 #include "WebAccessibilityObject.h" |
| 68 #include "WebActiveWheelFlingParameters.h" | 69 #include "WebActiveWheelFlingParameters.h" |
| 69 #include "WebAutofillClient.h" | 70 #include "WebAutofillClient.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 #include "core/platform/graphics/Extensions3D.h" | 143 #include "core/platform/graphics/Extensions3D.h" |
| 143 #include "core/platform/graphics/FontCache.h" | 144 #include "core/platform/graphics/FontCache.h" |
| 144 #include "core/platform/graphics/FontDescription.h" | 145 #include "core/platform/graphics/FontDescription.h" |
| 145 #include "core/platform/graphics/GraphicsContext.h" | 146 #include "core/platform/graphics/GraphicsContext.h" |
| 146 #include "core/platform/graphics/GraphicsContext3D.h" | 147 #include "core/platform/graphics/GraphicsContext3D.h" |
| 147 #include "core/platform/graphics/Image.h" | 148 #include "core/platform/graphics/Image.h" |
| 148 #include "core/platform/graphics/ImageBuffer.h" | 149 #include "core/platform/graphics/ImageBuffer.h" |
| 149 #include "core/platform/graphics/chromium/LayerPainterChromium.h" | 150 #include "core/platform/graphics/chromium/LayerPainterChromium.h" |
| 150 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" | 151 #include "core/platform/graphics/gpu/SharedGraphicsContext3D.h" |
| 151 #include "core/platform/network/ResourceHandle.h" | 152 #include "core/platform/network/ResourceHandle.h" |
| 152 #include "core/rendering/RenderLayerCompositor.h" | |
| 153 #include "core/rendering/RenderView.h" | 153 #include "core/rendering/RenderView.h" |
| 154 #include "core/rendering/RenderWidget.h" | 154 #include "core/rendering/RenderWidget.h" |
| 155 #include "core/rendering/TextAutosizer.h" | 155 #include "core/rendering/TextAutosizer.h" |
| 156 #include "modules/geolocation/GeolocationController.h" | 156 #include "modules/geolocation/GeolocationController.h" |
| 157 #include "weborigin/SchemeRegistry.h" | 157 #include "weborigin/SchemeRegistry.h" |
| 158 #include "weborigin/SecurityOrigin.h" | 158 #include "weborigin/SecurityOrigin.h" |
| 159 #include "weborigin/SecurityPolicy.h" | 159 #include "weborigin/SecurityPolicy.h" |
| 160 #include "painting/ContinuousPainter.h" | 160 #include "painting/ContinuousPainter.h" |
| 161 | 161 |
| 162 #if ENABLE(DEFAULT_RENDER_THEME) | 162 #if ENABLE(DEFAULT_RENDER_THEME) |
| (...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1605 } | 1605 } |
| 1606 | 1606 |
| 1607 // Set the fixed layout size from the viewport constraints before resizing. | 1607 // Set the fixed layout size from the viewport constraints before resizing. |
| 1608 updatePageDefinedPageScaleConstraints(mainFrameImpl()->frame()->document()-> viewportArguments()); | 1608 updatePageDefinedPageScaleConstraints(mainFrameImpl()->frame()->document()-> viewportArguments()); |
| 1609 | 1609 |
| 1610 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); | 1610 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); |
| 1611 if (agentPrivate) | 1611 if (agentPrivate) |
| 1612 agentPrivate->webViewResized(newSize); | 1612 agentPrivate->webViewResized(newSize); |
| 1613 if (!agentPrivate || !agentPrivate->metricsOverridden()) { | 1613 if (!agentPrivate || !agentPrivate->metricsOverridden()) { |
| 1614 WebFrameImpl* webFrame = mainFrameImpl(); | 1614 WebFrameImpl* webFrame = mainFrameImpl(); |
| 1615 if (webFrame->frameView()) | 1615 if (webFrame->frameView()) { |
| 1616 webFrame->frameView()->resize(m_size); | 1616 webFrame->frameView()->resize(m_size); |
| 1617 if (m_pinchViewports) | |
| 1618 m_pinchViewports->setViewportSize(m_size); | |
| 1619 } | |
| 1617 } | 1620 } |
| 1618 | 1621 |
| 1619 if (settings()->viewportEnabled()) { | 1622 if (settings()->viewportEnabled()) { |
| 1620 // Relayout immediately to recalculate the minimum scale limit. | 1623 // Relayout immediately to recalculate the minimum scale limit. |
| 1621 if (view->needsLayout()) | 1624 if (view->needsLayout()) |
| 1622 view->layout(); | 1625 view->layout(); |
| 1623 | 1626 |
| 1624 if (shouldAnchorAndRescaleViewport) { | 1627 if (shouldAnchorAndRescaleViewport) { |
| 1625 float viewportWidthRatio = static_cast<float>(newSize.width) / oldSi ze.width; | 1628 float viewportWidthRatio = static_cast<float>(newSize.width) / oldSi ze.width; |
| 1626 float contentsWidthRatio = static_cast<float>(contentsSize().width() ) / oldContentsWidth; | 1629 float contentsWidthRatio = static_cast<float>(contentsSize().width() ) / oldContentsWidth; |
| (...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3808 | 3811 |
| 3809 bool WebViewImpl::allowsAcceleratedCompositing() | 3812 bool WebViewImpl::allowsAcceleratedCompositing() |
| 3810 { | 3813 { |
| 3811 return !m_compositorCreationFailed; | 3814 return !m_compositorCreationFailed; |
| 3812 } | 3815 } |
| 3813 | 3816 |
| 3814 void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer) | 3817 void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer) |
| 3815 { | 3818 { |
| 3816 suppressInvalidations(true); | 3819 suppressInvalidations(true); |
| 3817 | 3820 |
| 3818 m_rootGraphicsLayer = layer; | 3821 if (page()->settings()->pinchVirtualViewportEnabled() && !m_pinchViewports) |
| 3819 m_rootLayer = layer ? layer->platformLayer() : 0; | 3822 m_pinchViewports = PinchViewports::create(this); |
| 3823 | |
| 3824 if (m_pinchViewports) { | |
|
aelias_OOO_until_Jul13
2013/06/18 19:52:28
nit: to clarify what's guarded by setting, I sugge
wjmaclean
2013/06/18 20:11:40
That is clearer, thanks!
Done.
| |
| 3825 m_pinchViewports->setOverflowControlsHostLayer(layer); | |
| 3826 m_pinchViewports->setViewportSize(mainFrameImpl()->frame()->view()->fram eRect().size()); | |
| 3827 if (layer) { | |
| 3828 m_rootGraphicsLayer = m_pinchViewports->rootGraphicsLayer(); | |
| 3829 m_rootLayer = m_pinchViewports->rootGraphicsLayer()->platformLayer() ; | |
| 3830 m_pinchViewports->registerViewportLayersWithTreeView(m_layerTreeView ); | |
| 3831 } else { | |
| 3832 m_rootGraphicsLayer = 0; | |
| 3833 m_rootLayer = 0; | |
| 3834 m_pinchViewports->clearViewportLayersForTreeView(m_layerTreeView); | |
| 3835 } | |
| 3836 } else { | |
| 3837 m_rootGraphicsLayer = layer; | |
| 3838 m_rootLayer = layer ? layer->platformLayer() : 0; | |
| 3839 } | |
| 3840 | |
| 3820 | 3841 |
| 3821 setIsAcceleratedCompositingActive(layer); | 3842 setIsAcceleratedCompositingActive(layer); |
| 3822 | 3843 |
| 3823 if (m_layerTreeView) { | 3844 if (m_layerTreeView) { |
| 3824 if (m_rootLayer) | 3845 if (m_rootLayer) |
| 3825 m_layerTreeView->setRootLayer(*m_rootLayer); | 3846 m_layerTreeView->setRootLayer(*m_rootLayer); |
| 3826 else | 3847 else |
| 3827 m_layerTreeView->clearRootLayer(); | 3848 m_layerTreeView->clearRootLayer(); |
| 3828 } | 3849 } |
| 3829 | 3850 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 3847 updateLayerTreeViewport(); | 3868 updateLayerTreeViewport(); |
| 3848 } else if (m_client) | 3869 } else if (m_client) |
| 3849 m_client->didInvalidateRect(rect); | 3870 m_client->didInvalidateRect(rect); |
| 3850 } | 3871 } |
| 3851 | 3872 |
| 3852 WebCore::GraphicsLayerFactory* WebViewImpl::graphicsLayerFactory() const | 3873 WebCore::GraphicsLayerFactory* WebViewImpl::graphicsLayerFactory() const |
| 3853 { | 3874 { |
| 3854 return m_graphicsLayerFactory.get(); | 3875 return m_graphicsLayerFactory.get(); |
| 3855 } | 3876 } |
| 3856 | 3877 |
| 3878 WebCore::RenderLayerCompositor* WebViewImpl::compositor() const | |
| 3879 { | |
| 3880 if (!page() | |
| 3881 || !page()->mainFrame() | |
| 3882 || !page()->mainFrame()->document() | |
| 3883 || !page()->mainFrame()->document()->renderView()) | |
| 3884 return 0; | |
| 3885 return page()->mainFrame()->document()->renderView()->compositor(); | |
| 3886 } | |
| 3887 | |
| 3857 void WebViewImpl::registerForAnimations(WebLayer* layer) | 3888 void WebViewImpl::registerForAnimations(WebLayer* layer) |
| 3858 { | 3889 { |
| 3859 if (m_layerTreeView) | 3890 if (m_layerTreeView) |
| 3860 m_layerTreeView->registerForAnimations(layer); | 3891 m_layerTreeView->registerForAnimations(layer); |
| 3861 } | 3892 } |
| 3862 | 3893 |
| 3863 WebCore::GraphicsLayer* WebViewImpl::rootGraphicsLayer() | 3894 WebCore::GraphicsLayer* WebViewImpl::rootGraphicsLayer() |
| 3864 { | 3895 { |
| 3865 return m_rootGraphicsLayer; | 3896 return m_rootGraphicsLayer; |
| 3866 } | 3897 } |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4096 } | 4127 } |
| 4097 | 4128 |
| 4098 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4129 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 4099 { | 4130 { |
| 4100 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); | 4131 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); |
| 4101 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom | 4132 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom |
| 4102 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); | 4133 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); |
| 4103 } | 4134 } |
| 4104 | 4135 |
| 4105 } // namespace WebKit | 4136 } // namespace WebKit |
| OLD | NEW |