summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webplugin_impl.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 23:28:21 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-31 23:28:21 +0000
commit8922de5133af29b6d89830f5df893b3eccf3c7c1 (patch)
tree063c92f565397698513d028dd657a0f868a355e8 /webkit/glue/webplugin_impl.cc
parent930d36bc6e6b640384de59a877ce1351fddc2fe2 (diff)
downloadchromium_src-8922de5133af29b6d89830f5df893b3eccf3c7c1.zip
chromium_src-8922de5133af29b6d89830f5df893b3eccf3c7c1.tar.gz
chromium_src-8922de5133af29b6d89830f5df893b3eccf3c7c1.tar.bz2
This fixes bug http://code.google.com/p/chromium/issues/detail?id=3881, which
was NPAPI plugin UI test failures. This occured as a sideeffect of the webkit merge. Some functions in widget.h which were implemented by WebPluginContainer no longer exist. We need to implement their replacements on similar lines. Bug=3881 R=jam Review URL: http://codereview.chromium.org/8775 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webplugin_impl.cc')
-rw-r--r--webkit/glue/webplugin_impl.cc30
1 files changed, 20 insertions, 10 deletions
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index 0251409..c428002 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -188,6 +188,26 @@ void WebPluginContainer::handleEvent(WebCore::Event* event) {
impl_->handleEvent(event);
}
+void WebPluginContainer::frameRectsChanged() const {
+ WebCore::Widget::frameRectsChanged();
+ // This is a hack to tickle re-positioning of the plugin in the case where
+ // our parent view was scrolled.
+ impl_->setFrameRect(frameRect());
+}
+
+// We override this function, to make sure that geometry updates are sent
+// over to the plugin. For e.g. when a plugin is instantiated it does
+// not have a valid parent. As a result the first geometry update from
+// webkit is ignored. This function is called when the plugin eventually
+// gets a parent.
+void WebPluginContainer::setParentVisible(bool visible) {
+ WebCore::Widget::setParentVisible(visible);
+ if (visible)
+ show();
+ else
+ hide();
+}
+
void WebPluginContainer::windowCutoutRects(const WebCore::IntRect& bounds,
WTF::Vector<WebCore::IntRect>*
cutouts) const {
@@ -590,16 +610,6 @@ void WebPluginImpl::windowCutoutRects(
}
}
-void WebPluginImpl::geometryChanged() const {
- if (!widget_)
- return;
-
- // This is a hack to tickle re-positioning of the plugin in the case where
- // our parent view was scrolled.
- const_cast<WebPluginImpl*>(this)->widget_->setFrameRect(
- widget_->frameRect());
-}
-
void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) {
// Compute a new position and clip rect for ourselves relative to the
// containing window. We ask our delegate to reposition us accordingly.