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

Unified Diff: chrome/browser/tab_contents/tab_contents_view_gtk.cc

Issue 363012: Only send renderer resize messages for RWHV sizing caused by (Closed)
Patch Set: Created 11 years, 1 month 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 | « chrome/browser/tab_contents/interstitial_page.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents_view_gtk.cc
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index a51aa10d2a00963bd4d33a3009d41bf34a146e15..ede66bb4abeea4e1ddaebf2e158169ce40b46462 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -398,8 +398,6 @@ gboolean TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget,
TabContentsViewGtk* view) {
int width = allocation->width;
int height = allocation->height;
- view->requested_size_.set_width(width);
- view->requested_size_.set_height(height);
// |delegate()| can be NULL here during browser teardown.
if (view->tab_contents()->delegate())
height += view->tab_contents()->delegate()->GetExtraRenderViewHeight();
@@ -407,6 +405,13 @@ gboolean TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget,
view->requested_size_ = size;
gtk_container_foreach(GTK_CONTAINER(widget), SetSizeRequest, &size);
+ // We manually tell our RWHV to resize the renderer content. This avoids
+ // spurious resizes from GTK+.
+ if (view->tab_contents()->render_widget_host_view())
+ view->tab_contents()->render_widget_host_view()->SetSize(size);
+ if (view->tab_contents()->interstitial_page())
+ view->tab_contents()->interstitial_page()->SetSize(size);
+
return FALSE;
}
« no previous file with comments | « chrome/browser/tab_contents/interstitial_page.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698