summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 00:54:08 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 00:54:08 +0000
commitb1fed96e16b03548fb19403093db944720e4b0ac (patch)
tree6a05b57bcb127c5844a9d367043a73e821a22d11 /chrome
parentc08af990cd01bc5354ecd2763516583fe4f028ae (diff)
downloadchromium_src-b1fed96e16b03548fb19403093db944720e4b0ac.zip
chromium_src-b1fed96e16b03548fb19403093db944720e4b0ac.tar.gz
chromium_src-b1fed96e16b03548fb19403093db944720e4b0ac.tar.bz2
Duplicate popup window should have same size and scroll
position as original popup. BUG=5632 (http://crbug.com/5632) Patch by Mohamed Mansour. Review URL: http://codereview.chromium.org/14812 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7195 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 87b3e9e..4ef2629 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1306,6 +1306,12 @@ void Browser::DuplicateContentsAt(int index) {
browser = Browser::CreateForPopup(profile_);
}
+ // Preserve the size of the original window. The new window has already
+ // been given an offset by the OS, so we shouldn't copy the old bounds.
+ BrowserWindow* new_window = browser->window();
+ new_window->SetBounds(gfx::Rect(new_window->GetNormalBounds().origin(),
+ window()->GetNormalBounds().size()));
+
// We need to show the browser now. Otherwise ContainerWin assumes the
// TabContents is invisible and won't size it.
browser->window()->Show();