fix: use coordinate offsets in ShowAutofillPopup (#20232)

* fix: use coordinate offsets in ShowAutofillPopup

* fix: silence coord int->float narrowing conversion

Minor fix to silence clang-tidy warning about implicit range narrowing.
Not a huge deal but the revision is also easier to read.

clang-tidy: bugprone-narrowing-conversions
This commit is contained in:
Charles Kerr 2019-09-19 10:05:57 -05:00 committed by Shelley Vohr
parent 3f5833ce5d
commit 63f08fcdb0

View file

@ -47,13 +47,13 @@ void AutofillDriver::ShowAutofillPopup(
auto* view = web_contents->web_contents()->GetMainFrame()->GetView();
auto offset = view->GetViewBounds().origin() -
embedder_view->GetViewBounds().origin();
popup_bounds.Offset(offset.x(), offset.y());
popup_bounds.Offset(offset);
embedder_frame_host = embedder->web_contents()->GetMainFrame();
}
autofill_popup_->CreateView(render_frame_host_, embedder_frame_host, osr,
web_contents->owner_window()->content_view(),
bounds);
popup_bounds);
autofill_popup_->SetItems(values, labels);
}