diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 22:10:30 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 22:10:30 +0000 |
commit | 41e0e0f06a5e43b76d466c5537d769ce3fd88b89 (patch) | |
tree | e35deff69d419f59bbc6204d2abc96e8b2eefa58 | |
parent | 77767745f94bb6e2ae267260de97af697fd2af82 (diff) | |
download | chromium_src-41e0e0f06a5e43b76d466c5537d769ce3fd88b89.zip chromium_src-41e0e0f06a5e43b76d466c5537d769ce3fd88b89.tar.gz chromium_src-41e0e0f06a5e43b76d466c5537d769ce3fd88b89.tar.bz2 |
Removed logic which made the container size 0 when recreating a tab contents
BUG=37048
TEST=Run browser, kill the renderer to get the sad tab, refresh the tab.
The contents of the tab should be displayed.
Review URL: http://codereview.chromium.org/660262
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40447 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/tab_contents/tab_contents_view_gtk.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc index 73ad43b..98f6800 100644 --- a/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/views/tab_contents/tab_contents_view_gtk.cc @@ -358,9 +358,9 @@ gboolean TabContentsViewGtk::OnButtonPress(GtkWidget* widget, void TabContentsViewGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { gfx::Size new_size(allocation->width, allocation->height); - if (new_size == size_) - return; + // Always call WasSized() to allow checking to make sure the + // RenderWidgetHostView is the right size. WasSized(new_size); } @@ -388,14 +388,23 @@ void TabContentsViewGtk::WasShown() { } void TabContentsViewGtk::WasSized(const gfx::Size& size) { - size_ = size; - if (tab_contents()->interstitial_page()) - tab_contents()->interstitial_page()->SetSize(size); + // We have to check that the RenderWidgetHostView is the proper size. + // It can be wrong in cases where the renderer has died and the host + // view needed to be recreated. + bool needs_resize = size != size_; + + if (needs_resize) { + size_ = size; + if (tab_contents()->interstitial_page()) + tab_contents()->interstitial_page()->SetSize(size); + } + RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); - if (rwhv) + if (rwhv && rwhv->GetViewBounds().size() != size) rwhv->SetSize(size); - SetFloatingPosition(size); + if (needs_resize) + SetFloatingPosition(size); } void TabContentsViewGtk::SetFloatingPosition(const gfx::Size& size) { |