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

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

Issue 165468: Take 2 at fixing anchor links opening in background tabs on linux. (Closed)
Patch Set: Created 11 years, 4 months 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/browser.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 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() {
« no previous file with comments | « chrome/browser/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698