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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_views.cc

Issue 7812002: Fixed combobox popup positioning after a change in GetViewBounds. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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/renderer_host/render_widget_host_view_views.cc
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc
index 53f1aedbefce6f8c2a75c2cec8569b8a75bccb48..b2ade9a0a944302c40fcf8289a4cf4c3c2636123 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc
@@ -122,7 +122,13 @@ void RenderWidgetHostViewViews::InitAsPopup(
// to tell the parent it's showing a popup so that it doesn't respond to
// blurs.
parent->is_showing_context_menu_ = true;
- views::View::SetBoundsRect(pos);
+
+ // pos is in screen coordinates but a view is positioned relative
+ // to its parent. Here we convert screen coordinates to relative
+ // coordinates.
+ gfx::Point p(pos.x() - parent_host_view->GetViewBounds().x(),
+ pos.y() - parent_host_view->GetViewBounds().y());
+ views::View::SetBounds(p.x(), p.y(), pos.width(), pos.height());
Show();
if (NeedsInputGrab()) {
« 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