summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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