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

Unified Diff: chrome/browser/browser.cc

Issue 164462: Merge r22016 -- Force sizing of a new tab as soon as TabContents is created.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/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 | « no previous file | chrome/browser/tab_contents/web_contents_view_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 23283)
+++ chrome/browser/browser.cc (working copy)
@@ -1398,6 +1398,17 @@
TabContents* contents = TabContents::CreateWithType(type, profile, instance);
contents->SetupController(profile);
+ // Ensure that the new TabContentsView begins at the same size as the
+ // previous TabContentsView if it existed. Otherwise, the initial WebKit
+ // layout will be performed based on a width of 0 pixels, causing a
+ // very long, narrow, inaccurate layout. Because some scripts on pages (as
+ // well as WebKit's anchor link location calculation) are run on the initial
+ // layout and not recalculated later, we need to ensure the first layout is
+ // performed with sane view dimensions even when we're opening a new
+ // background tab.
+ if (TabContents* old_contents = tabstrip_model_.GetSelectedTabContents())
+ contents->view()->SizeContents(old_contents->view()->GetContainerSize());
+
if (!defer_load) {
// Load the initial URL before adding the new tab contents to the tab strip
// so that the tab contents has navigation state.
Property changes on: chrome\browser\browser.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/browser.cc:r14162,14665,15810,15950,16015,16808,18093,18210,18321,18640,18871,19044,19692,19978,19995,22016
« no previous file with comments | « no previous file | chrome/browser/tab_contents/web_contents_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698