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

Unified Diff: chrome/browser/browser.cc

Issue 165473: Better location for setting the size of tab contents. This should (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 | « no previous file | chrome/browser/tabs/tab_strip_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 5fae3c8986f8d0a3798034c6ec68ead5f98effa3..c6c7ce60f122651b4c3f0321379bee227cb52681 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1503,17 +1503,6 @@ TabContents* Browser::CreateTabContentsForURL(
TabContents* contents = new TabContents(profile, instance,
MSG_ROUTING_NONE, NULL);
- // 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());
Nate Chapin 2009/08/13 18:56:54 My impression (and this could be entirely wrong) w
-
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.
@@ -1831,18 +1820,6 @@ void Browser::AddNewContents(TabContents* source,
initial_pos, user_gesture);
browser->window()->Show();
} else if (disposition != SUPPRESS_OPEN) {
- // 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()) {
- new_contents->view()->SizeContents(
- old_contents->view()->GetContainerSize());
- }
tabstrip_model_.AddTabContents(new_contents, -1, false,
PageTransition::LINK,
disposition == NEW_FOREGROUND_TAB);
« no previous file with comments | « no previous file | chrome/browser/tabs/tab_strip_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698