summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 20:45:47 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-13 20:45:47 +0000
commit7c4e04ad0765c20123b191f13a5912a3cb1260d2 (patch)
tree4798bb587aca0c7e737060f3d6b5c2eabf55ad5c /chrome/browser/browser.cc
parent5873de6186d9997573cfad69131a84f1b69ddd45 (diff)
downloadchromium_src-7c4e04ad0765c20123b191f13a5912a3cb1260d2.zip
chromium_src-7c4e04ad0765c20123b191f13a5912a3cb1260d2.tar.gz
chromium_src-7c4e04ad0765c20123b191f13a5912a3cb1260d2.tar.bz2
Better location for setting the size of tab contents. This should
catch all code paths. I noticed that middle clicking a bookmark wasn't working, so I found a single place to do this. This code is always run when a tab is added and it sizes the contents when it's loading in the background. BUG=619 Review URL: http://codereview.chromium.org/165473 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc23
1 files changed, 0 insertions, 23 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 5fae3c8..c6c7ce6 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());
-
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);