Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Merge pull request #44 from bsclifton/fix-autofill-position
Browse files Browse the repository at this point in the history
Changes needed to fix autofill context menu position
  • Loading branch information
bridiver authored Aug 24, 2016
2 parents 9e2c01c + 76dd813 commit 23af031
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions atom/browser/autofill/atom_autofill_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ void AtomAutofillClient::ShowAutofillPopup(
v8::HandleScope handle_scope(api_web_contents_->isolate());
mate::Dictionary rect =
mate::Dictionary::CreateEmpty(api_web_contents_->isolate());
// Convert element_bounds to be in screen space.
gfx::Rect client_area = web_contents()->GetContainerBounds();
gfx::RectF element_bounds_in_screen_space =
element_bounds + client_area.OffsetFromOrigin();
rect.Set("x", element_bounds_in_screen_space.x());
rect.Set("y", element_bounds_in_screen_space.y());
rect.Set("width", element_bounds_in_screen_space.width());
rect.Set("height", element_bounds_in_screen_space.height());
rect.Set("x", element_bounds.x());
rect.Set("y", element_bounds.y());
rect.Set("width", element_bounds.width());
rect.Set("height", element_bounds.height());
rect.Set("clientWidth", client_area.width());
rect.Set("clientHeight", client_area.height());

api_web_contents_->Emit("show-autofill-popup",
suggestions,
rect);
Expand Down

0 comments on commit 23af031

Please sign in to comment.