summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webplugin_impl.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-20 01:45:12 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-20 01:45:12 +0000
commit0405e11991b06184e1a03ab7b56c2a695714678c (patch)
tree7eef0fd3811e0fe0c877f8a48fd5ff5d5fe122d9 /webkit/glue/webplugin_impl.cc
parente4182160e5cfb36d623ca3f7baef71ea4fd980af (diff)
downloadchromium_src-0405e11991b06184e1a03ab7b56c2a695714678c.zip
chromium_src-0405e11991b06184e1a03ab7b56c2a695714678c.tar.gz
chromium_src-0405e11991b06184e1a03ab7b56c2a695714678c.tar.bz2
The street view in Google maps, which is implemented with a windowed flash plugin would draw over the iframe DOM
element, effectively hiding it. This is handled by our IFrame shim geometry calculation, where we subtract the rect of any IFrame above the plugin in the ZOrder from the plugin rect. Webkit calls Widget::setFrameRect at various times, during layout/size changes/paints, etc. The reason this bug showed up, was due to an optimization in our setFrameRect implementation, where we would bail out if the rect passed in was the same size as the current plugin rect. Basically the IFrame appears above the plugin in the ZOrder much later, which causes us to return without sending over the cutout rects to the browser when it moves the plugin windows. Fix is to move the rects equality check to WebPluginImpl::setFrameRect, where we don't send over the UpdateGeometry IPC to the plugin process if the rects are the same. WebPluginImpl used to implement the webkit Widget interface a long time ago. This is no longer the case. So some of the functions don't need to be virtual anymore. I also made this change. This fixes bug http://b/issue?id=1722236 and http://code.google.com/p/chromium/issues/detail?id=8858 Bug=1722236,8858 Review URL: http://codereview.chromium.org/42413 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webplugin_impl.cc')
-rw-r--r--webkit/glue/webplugin_impl.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index 1db23f9..0a56271 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -131,13 +131,12 @@ bool WebPluginContainer::isPluginView() const {
void WebPluginContainer::setFrameRect(const WebCore::IntRect& rect) {
- // WebKit calls move every time it paints (see RenderWidget::paint). No need
- // to do expensive operations if we didn't actually move.
- if (rect == frameRect())
- return;
+ bool widget_dimensions_changed = (rect != frameRect());
+
+ if (widget_dimensions_changed)
+ WebCore::Widget::setFrameRect(rect);
- WebCore::Widget::setFrameRect(rect);
- impl_->setFrameRect(rect);
+ impl_->setFrameRect(rect, widget_dimensions_changed);
}
void WebPluginContainer::paint(WebCore::GraphicsContext* gc,
@@ -197,7 +196,7 @@ void WebPluginContainer::frameRectsChanged() {
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());
+ impl_->setFrameRect(frameRect(), true);
}
// We override this function, to make sure that geometry updates are sent
@@ -220,7 +219,7 @@ void WebPluginContainer::setParentVisible(bool visible) {
void WebPluginContainer::setParent(WebCore::ScrollView* view) {
WebCore::Widget::setParent(view);
if (view) {
- impl_->setFrameRect(frameRect());
+ impl_->setFrameRect(frameRect(), true);
impl_->delegate_->FlushGeometryUpdates();
}
}
@@ -638,7 +637,8 @@ void WebPluginImpl::windowCutoutRects(
}
}
-void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) {
+void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect,
+ bool widget_dimensions_changed) {
if (!parent())
return;
@@ -658,9 +658,11 @@ void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) {
std::vector<gfx::Rect> cutout_rects;
CalculateBounds(rect, &window_rect, &clip_rect, &cutout_rects);
- delegate_->UpdateGeometry(
- webkit_glue::FromIntRect(window_rect),
- webkit_glue::FromIntRect(clip_rect));
+ if (widget_dimensions_changed) {
+ delegate_->UpdateGeometry(
+ webkit_glue::FromIntRect(window_rect),
+ webkit_glue::FromIntRect(clip_rect));
+ }
if (window_) {
// Let the WebViewDelegate know that the plugin window needs to be moved,