Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1464)

Unified Diff: chrome/browser/ui/views/extensions/extension_popup.cc

Issue 6544020: Correct browser action popup regression (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/extension_popup.cc
===================================================================
--- chrome/browser/ui/views/extensions/extension_popup.cc (revision 75135)
+++ chrome/browser/ui/views/extensions/extension_popup.cc (working copy)
@@ -156,6 +156,13 @@
// 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 @@
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698