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

Changes needed to fix autofill context menu position #44

Merged
merged 1 commit into from
Aug 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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