summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
commit284837daa07b29d6a63a748544a90b1f5842ac5c (patch)
treeecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebKit2/WebProcess/Plugins/PluginView.cpp
parent2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff)
downloadqtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins/PluginView.cpp')
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginView.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
index d07f8b79d..0a0c6b63d 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -407,10 +407,10 @@ void PluginView::webPageDestroyed()
#if PLATFORM(MAC)
void PluginView::setWindowIsVisible(bool windowIsVisible)
{
- if (!m_plugin)
+ if (!m_isInitialized || !m_plugin)
return;
- // FIXME: Implement.
+ m_plugin->windowVisibilityChanged(windowIsVisible);
}
void PluginView::setWindowIsFocused(bool windowIsFocused)
@@ -550,6 +550,10 @@ JSObject* PluginView::scriptObject(JSGlobalObject* globalObject)
if (m_isWaitingForSynchronousInitialization)
return 0;
+ // The plug-in can be null here if it failed to initialize previously.
+ if (!m_plugin)
+ return 0;
+
// If the plug-in exists but is not initialized then we're still initializing asynchronously.
// We need to wait here until initialization has either succeeded or failed.
if (m_plugin->isBeingAsynchronouslyInitialized()) {
@@ -558,7 +562,7 @@ JSObject* PluginView::scriptObject(JSGlobalObject* globalObject)
m_isWaitingForSynchronousInitialization = false;
}
- // The plug-in can be null here if it failed to initialize.
+ // The plug-in can be null here if it still failed to initialize.
if (!m_isInitialized || !m_plugin)
return 0;
@@ -583,6 +587,9 @@ void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
if (!m_isInitialized || !m_plugin)
return;
+ if (!privateBrowsingEnabled && !frame()->document()->securityOrigin()->canAccessPluginStorage(frame()->tree()->top()->document()->securityOrigin()))
+ return;
+
m_plugin->privateBrowsingStateChanged(privateBrowsingEnabled);
}
@@ -785,8 +792,19 @@ void PluginView::viewGeometryDidChange()
transform.translate(scaledLocationInRootViewCoordinates.x(), scaledLocationInRootViewCoordinates.y());
transform.scale(pageScaleFactor);
- // FIXME: The clip rect isn't correct.
+ // FIXME: The way we calculate this clip rect isn't correct.
+ // But it is still important to distinguish between empty and non-empty rects so we can notify the plug-in when it becomes invisible.
+ // Making the rect actually correct is covered by https://bugs.webkit.org/show_bug.cgi?id=95362
IntRect clipRect = boundsRect();
+
+ // FIXME: We can only get a semi-reliable answer from clipRectInWindowCoordinates() when the page is not scaled.
+ // Fixing that is tracked in <rdar://problem/9026611> - Make the Widget hierarchy play nicely with transforms, for zoomed plug-ins and iframes
+ if (pageScaleFactor == 1) {
+ clipRect = clipRectInWindowCoordinates();
+ if (!clipRect.isEmpty())
+ clipRect = boundsRect();
+ }
+
m_plugin->geometryDidChange(size(), clipRect, transform);
}
@@ -1262,6 +1280,9 @@ bool PluginView::isPrivateBrowsingEnabled()
if (!frame())
return true;
+ if (!frame()->document()->securityOrigin()->canAccessPluginStorage(frame()->tree()->top()->document()->securityOrigin()))
+ return true;
+
Settings* settings = frame()->settings();
if (!settings)
return true;