summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 17:27:35 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 17:27:35 +0000
commite1c41ac26e14a8c4a0c40d07a242da14cad57c1d (patch)
treeda715be637546547407a790bbb727ef44416f89a /chrome/browser/tab_contents
parentd6336a9e8c15b5f3b0be1da2685fcc471e27fbac (diff)
downloadchromium_src-e1c41ac26e14a8c4a0c40d07a242da14cad57c1d.zip
chromium_src-e1c41ac26e14a8c4a0c40d07a242da14cad57c1d.tar.gz
chromium_src-e1c41ac26e14a8c4a0c40d07a242da14cad57c1d.tar.bz2
Fix anchor links opening in background tabs on linux. Also fix
a code path that seems to be missing on Windows (maybe this regressed?). BUG=619 TEST=http://code.google.com/p/chromium/issues/detail?id=619#c6 Review URL: http://codereview.chromium.org/164452 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23317 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index 9bb7036..1afa864 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -575,8 +575,14 @@ 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.
+ GtkWidget* widget =
+ tab_contents()->render_widget_host_view()->GetNativeView();
+ widget->allocation.width = size.width();
+ widget->allocation.height = size.height();
}
void TabContentsViewGtk::Focus() {