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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 9702068: Move extension pop-ups and notifications to the new auto-resize code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small update Created 8 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 | « content/browser/renderer_host/render_widget_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 27438528b0ad2bbc2967a85c85bc6a603aa9a00f..afaff8b4bb70f08bdae8ffb448e60e4e74d31402 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1186,7 +1186,14 @@ void RenderWidgetHostImpl::OnMsgUpdateRect(
}
if (should_auto_resize_) {
- OnRenderAutoResized(params.view_size);
+ bool post_callback = new_auto_size_.IsEmpty();
sky 2012/03/20 16:15:06 Add a comment as to why you need to do this.
+ new_auto_size_ = params.view_size;
+ if (post_callback) {
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&RenderWidgetHostImpl::DelayedAutoResized,
+ weak_factory_.GetWeakPtr()));
+ }
}
// Log the time delta for processing a paint message. On platforms that don't
@@ -1689,4 +1696,13 @@ void RenderWidgetHostImpl::AcknowledgePostSubBuffer(int32 route_id,
ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id));
}
+void RenderWidgetHostImpl::DelayedAutoResized() {
+ gfx::Size new_size = new_auto_size_;
+ new_auto_size_.SetSize(0, 0);
+ if (!should_auto_resize_)
+ return;
+
+ OnRenderAutoResized(new_size);
+}
+
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698