summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 23:01:05 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-04 23:01:05 +0000
commite1401f7d47c1e3fd64fc2a9088871d616be95405 (patch)
treecfbbf58922ae81e0532c3cf1e6cb811f344aa7eb /chrome/browser/tab_contents
parent31eaf5a68a234438a5fd5421825c024a8ceea20f (diff)
downloadchromium_src-e1401f7d47c1e3fd64fc2a9088871d616be95405.zip
chromium_src-e1401f7d47c1e3fd64fc2a9088871d616be95405.tar.gz
chromium_src-e1401f7d47c1e3fd64fc2a9088871d616be95405.tar.bz2
Only send renderer resize messages for RWHV sizing caused by
TCV's size allocate message. This avoids a spurious size-allocate being sent to the renderers when creating a new tab. The extra size-allocate is called by the build-in GtkFixed's size allocate method. Another way to think of this is that we only size our RWH directly and decouple it's sizing from the GTK+ widget's sizing. BUG=26495 Review URL: http://codereview.chromium.org/363012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31031 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/interstitial_page.cc4
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.cc9
2 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/tab_contents/interstitial_page.cc b/chrome/browser/tab_contents/interstitial_page.cc
index b2dec89..34e008c 100644
--- a/chrome/browser/tab_contents/interstitial_page.cc
+++ b/chrome/browser/tab_contents/interstitial_page.cc
@@ -457,13 +457,13 @@ void InterstitialPage::DontProceed() {
}
void InterstitialPage::SetSize(const gfx::Size& size) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX)
// When a tab is closed, we might be resized after our view was NULLed
// (typically if there was an info-bar).
if (render_view_host_->view())
render_view_host_->view()->SetSize(size);
#else
- // TODO(port): do Mac or Linux need to SetSize?
+ // TODO(port): Does Mac need to SetSize?
NOTIMPLEMENTED();
#endif
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index a51aa10..ede66bb 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;
}