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

Unified Diff: webkit/glue/webplugin_impl.cc

Issue 42413: The street view in Google maps, which is implemented with a windowed flash pl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« no previous file with comments | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webplugin_impl.cc
===================================================================
--- webkit/glue/webplugin_impl.cc (revision 12166)
+++ webkit/glue/webplugin_impl.cc (working copy)
@@ -131,13 +131,12 @@
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());
- WebCore::Widget::setFrameRect(rect);
- impl_->setFrameRect(rect);
+ if (widget_dimensions_changed)
+ WebCore::Widget::setFrameRect(rect);
+
+ impl_->setFrameRect(rect, widget_dimensions_changed);
}
void WebPluginContainer::paint(WebCore::GraphicsContext* gc,
@@ -197,7 +196,7 @@
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::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::setFrameRect(const WebCore::IntRect& rect) {
+void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect,
+ bool widget_dimensions_changed) {
if (!parent())
return;
@@ -658,9 +658,11 @@
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,
« no previous file with comments | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698