Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: webkit/api/src/WebPluginContainerImpl.cpp

Issue 181014: Eliminate remaining WebCore dependencies from webplugin_impl.cc... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webkit/api/src/WebPluginContainerImpl.cpp
===================================================================
--- webkit/api/src/WebPluginContainerImpl.cpp (revision 25087)
+++ webkit/api/src/WebPluginContainerImpl.cpp (working copy)
@@ -72,15 +72,7 @@
void WebPluginContainerImpl::setFrameRect(const IntRect& frameRect)
{
Widget::setFrameRect(frameRect);
-
- if (!parent())
- return;
-
- IntRect windowRect, clipRect;
- Vector<IntRect> cutOutRects;
- calculateGeometry(frameRect, windowRect, clipRect, cutOutRects);
-
- m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible());
+ reportGeometry();
}
void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRect)
@@ -173,10 +165,7 @@
void WebPluginContainerImpl::frameRectsChanged()
{
Widget::frameRectsChanged();
-
- // This is a hack to tickle re-positioning of the plugin in the case where
- // our parent view was scrolled.
- setFrameRect(frameRect());
+ reportGeometry();
}
void WebPluginContainerImpl::setParentVisible(bool parentVisible)
@@ -206,7 +195,7 @@
Widget::setParent(view);
if (view)
- setFrameRect(frameRect());
+ reportGeometry();
}
void WebPluginContainerImpl::invalidate()
@@ -219,6 +208,26 @@
invalidateRect(static_cast<IntRect>(rect));
}
+void WebPluginContainerImpl::reportGeometry()
+{
+ if (!parent())
+ return;
+
+ IntRect windowRect, clipRect;
+ Vector<IntRect> cutOutRects;
+ calculateGeometry(frameRect(), windowRect, clipRect, cutOutRects);
+
+ m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible());
+}
+
+void WebPluginContainerImpl::clearScriptObjects()
+{
+ Frame* frame = m_element->document()->frame();
+ if (!frame)
+ return;
+ frame->script()->cleanupScriptObjectsForPlugin(this);
+}
+
NPObject* WebPluginContainerImpl::scriptableObjectForElement()
{
return m_element->getNPObject();

Powered by Google App Engine
This is Rietveld 408576698