diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-25 15:09:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-25 15:09:11 +0200 |
commit | a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch) | |
tree | b7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Source/WebKit2/WebProcess/Plugins/PluginView.cpp | |
parent | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff) | |
download | qtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz |
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins/PluginView.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/Plugins/PluginView.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
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<HTMLPlugInElement> pluginElement, PassRefPtr<P #endif , m_manualStreamState(StreamStateInitial) { -#if PLATFORM(MAC) m_webPage->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(); |