Chromium Code Reviews| 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 9bb7036cd2f362dd3c435d702ed68361d918e476..00c546dd4db13775f5467e91770e76fee55b4181 100644 |
| --- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc |
| +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc |
| @@ -575,8 +575,16 @@ void TabContentsViewGtk::OnTabCrashed() { |
| } |
| void TabContentsViewGtk::SizeContents(const gfx::Size& size) { |
| - // This function is a hack and should go away. In any case we don't manually |
| - // control the size of the contents on linux, so do nothing. |
| + // We don't normally need to manually set the size of of widgets in GTK+, |
| + // but this is used when creating background tabs. When a tab is created in |
| + // the background, we need to set the size so WebKit can properly compute |
| + // the scrolling offset if a #ref is provided. |
| + if (tab_contents()->render_widget_host_view()) { |
|
Nate Chapin
2009/08/13 18:24:36
I don't have a great understanding of this layer o
Evan Stade
2009/08/13 18:30:52
The tab contents view doesn't own the RWHV, so no.
|
| + GtkWidget* widget = |
| + tab_contents()->render_widget_host_view()->GetNativeView(); |
| + widget->allocation.width = size.width(); |
| + widget->allocation.height = size.height(); |
| + } |
| } |
| void TabContentsViewGtk::Focus() { |