summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-18 22:24:42 +0000
committertwiz@chromium.org <twiz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-18 22:24:42 +0000
commit6ce1ce3445e5bbdd9c4d10fb2c3467f20627e342 (patch)
tree8214713009cdca63ab588a738d0326686e736291
parent33d6752e62f1e94c16560e2991ff307033686af0 (diff)
downloadchromium_src-6ce1ce3445e5bbdd9c4d10fb2c3467f20627e342.zip
chromium_src-6ce1ce3445e5bbdd9c4d10fb2c3467f20627e342.tar.gz
chromium_src-6ce1ce3445e5bbdd9c4d10fb2c3467f20627e342.tar.bz2
Correct the screen-space positioning of browser-action popup dialogs.
Regression was introduced in CL http://codereview.chromium.org/6334101 BUG=73353 TEST=None Review URL: http://codereview.chromium.org/6544020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75454 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/views/extensions/extension_popup.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc
index 15a6a26..a7f4300 100644
--- a/chrome/browser/ui/views/extensions/extension_popup.cc
+++ b/chrome/browser/ui/views/extensions/extension_popup.cc
@@ -156,6 +156,13 @@ void ExtensionPopup::ResizeToView() {
// know our position to do it.
gfx::Size new_size = view()->size();
+ // |relative_to_| is in browser-relative coordinates, so convert it to
+ // screen coordinates for use in placing the popup widgets.
+ gfx::Rect relative_rect = relative_to_;
+ gfx::Point relative_origin = relative_rect.origin();
+ views::View::ConvertPointToScreen(frame_->GetRootView(), &relative_origin);
+ relative_rect.set_origin(relative_origin);
+
// The rounded corners cut off more of the view than the border insets claim.
// Since we can't clip the ExtensionView's corners, we need to increase the
// inset by half the corner radius as well as lying about the size of the
@@ -163,7 +170,7 @@ void ExtensionPopup::ResizeToView() {
int corner_inset = BubbleBorder::GetCornerRadius() / 2;
gfx::Size adjusted_size = new_size;
adjusted_size.Enlarge(2 * corner_inset, 2 * corner_inset);
- gfx::Rect rect = border_->GetBounds(relative_to_, adjusted_size);
+ gfx::Rect rect = border_->GetBounds(relative_rect, adjusted_size);
border_widget_->SetBounds(rect);
// Now calculate the inner bounds. This is a bit more convoluted than