From a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 25 May 2012 15:09:11 +0200 Subject: Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516) --- Source/WebKit2/WebProcess/Plugins/PluginView.cpp | 26 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'Source/WebKit2/WebProcess/Plugins/PluginView.cpp') diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp index de17915b0..2191688e1 100644 --- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp +++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp @@ -268,16 +268,13 @@ PluginView::PluginView(PassRefPtr pluginElement, PassRefPtr

addPluginView(this); -#endif } PluginView::~PluginView() { -#if PLATFORM(MAC) - m_webPage->removePluginView(this); -#endif + if (m_webPage) + m_webPage->removePluginView(this); ASSERT(!m_isBeingDestroyed); @@ -293,7 +290,8 @@ PluginView::~PluginView() m_plugin->destroyPlugin(); m_isBeingDestroyed = false; #if PLATFORM(MAC) - pluginFocusOrWindowFocusChanged(false); + if (m_webPage) + pluginFocusOrWindowFocusChanged(false); #endif } @@ -395,6 +393,16 @@ RenderBoxModelObject* PluginView::renderer() const return toRenderBoxModelObject(m_pluginElement->renderer()); } +void PluginView::pageScaleFactorDidChange() +{ + viewGeometryDidChange(); +} + +void PluginView::webPageDestroyed() +{ + m_webPage = 0; +} + #if PLATFORM(MAC) void PluginView::setWindowIsVisible(bool windowIsVisible) { @@ -748,15 +756,15 @@ void PluginView::viewGeometryDidChange() return; ASSERT(frame()); - float frameScaleFactor = frame()->frameScaleFactor(); + float pageScaleFactor = frame()->page() ? frame()->page()->pageScaleFactor() : 1; - IntPoint scaledFrameRectLocation(frameRect().location().x() * frameScaleFactor, frameRect().location().y() * frameScaleFactor); + IntPoint scaledFrameRectLocation(frameRect().location().x() * pageScaleFactor, frameRect().location().y() * pageScaleFactor); IntPoint scaledLocationInRootViewCoordinates(parent()->contentsToRootView(scaledFrameRectLocation)); // FIXME: We still don't get the right coordinates for transformed plugins. AffineTransform transform; transform.translate(scaledLocationInRootViewCoordinates.x(), scaledLocationInRootViewCoordinates.y()); - transform.scale(frameScaleFactor); + transform.scale(pageScaleFactor); // FIXME: The clip rect isn't correct. IntRect clipRect = boundsRect(); -- cgit v1.2.1