diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-08 19:38:25 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-08 19:38:25 +0000 |
commit | 43091120667564aef3babcf04975cb75044bd2f5 (patch) | |
tree | 78efe8b49e901b423c1739c14362c60af37da9a0 | |
parent | 8ee8189e6ae18d1d9ada90601b0c4e1b08c865d8 (diff) | |
download | chromium_src-43091120667564aef3babcf04975cb75044bd2f5.zip chromium_src-43091120667564aef3babcf04975cb75044bd2f5.tar.gz chromium_src-43091120667564aef3babcf04975cb75044bd2f5.tar.bz2 |
Fix problem with popups frames when magic_browzr.
Some code got committed which made assumptions which
were only true when magic_browzr was on.
Review URL: http://codereview.chromium.org/5649
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3033 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/constrained_window_impl.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index 7da4086..6c5c3f4 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -1183,15 +1183,24 @@ void ConstrainedWindowImpl::Detach() { CRect bounds; ::GetWindowRect(constrained_contents_->GetContainerHWND(), &bounds); - // ... but overwrite its screen position with the screen position of its - // containing ConstrainedWindowImpl. We do this because the code called by - // |DetachContents| assumes the bounds contains position and size information - // similar to what is sent when a popup is not suppressed and must be opened, - // i.e. the position is the screen position of the top left of the detached - // popup window, and the size is the size of the content area. - bounds.SetRect(constrained_window_bounds.left, constrained_window_bounds.top, - constrained_window_bounds.left + bounds.Width(), - constrained_window_bounds.top + bounds.Height()); + // This block of code was added by Ben, and is simply false in any world with + // magic_browzr turned off. Eventually, the if block here should go away once + // we get rid of the old pre-magic_browzr window implementation, but for now + // (and at least the next beta release), it's here to stay and magic_browzr + // is off by default. + if (g_browser_process->IsUsingNewFrames()) { + // ... but overwrite its screen position with the screen position of its + // containing ConstrainedWindowImpl. We do this because the code called by + // |DetachContents| assumes the bounds contains position and size + // information similar to what is sent when a popup is not suppressed and + // must be opened, i.e. the position is the screen position of the top left + // of the detached popup window, and the size is the size of the content + // area. + bounds.SetRect(constrained_window_bounds.left, + constrained_window_bounds.top, + constrained_window_bounds.left + bounds.Width(), + constrained_window_bounds.top + bounds.Height()); + } // Save the cursor position so that we know where to send a mouse message // when the new detached window is created. |