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

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

Issue 165477: Merge 23332 - Take 2 at fixing anchor links opening in background tabs on lin... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
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
===================================================================
--- chrome/browser/tab_contents/tab_contents_view_gtk.cc (revision 23340)
+++ chrome/browser/tab_contents/tab_contents_view_gtk.cc (working copy)
@@ -580,8 +580,16 @@
}
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()) {
+ GtkWidget* widget =
+ tab_contents()->render_widget_host_view()->GetNativeView();
+ widget->allocation.width = size.width();
+ widget->allocation.height = size.height();
+ }
}
void TabContentsViewGtk::Focus() {
Property changes on: chrome\browser\tab_contents\tab_contents_view_gtk.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/tab_contents/tab_contents_view_gtk.cc:r23332
« 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