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

Unified Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 1516723003: [Element / Autofill] Add boundsInViewportFloat() to fix <input> popup misalignment. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refator to use boundsInViewportFloat() eventually, but keep boundsInViewportInt(). Created 5 years 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
Index: components/autofill/content/renderer/password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index 4fe2a14332d4122b6568bd6a15d1cb4fc636f277..4c2419ee015edaf53c1617d75267ef9510c1117e 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -26,6 +26,7 @@
#include "content/public/renderer/navigation_state.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
+#include "third_party/WebKit/public/platform/WebFloatRect.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebAutofillClient.h"
#include "third_party/WebKit/public/web/WebDocument.h"
@@ -1438,10 +1439,9 @@ bool PasswordAutofillAgent::ShowSuggestionPopup(
username.isNull() ? base::string16()
: static_cast<base::string16>(user_input.value()));
- blink::WebRect bounding_box_in_window = selected_element.boundsInViewport();
- render_frame()->GetRenderView()->convertViewportToWindow(
- &bounding_box_in_window);
-
+ blink::WebFloatRect bounding_box_in_window;
+ render_frame()->GetRenderView()->getElementBoundingBoxWindow(
+ &selected_element, &bounding_box_in_window);
Send(new AutofillHostMsg_ShowPasswordSuggestions(
routing_id(), key_it->second, field.text_direction, username_string,
options, gfx::RectF(bounding_box_in_window)));

Powered by Google App Engine
This is Rietveld 408576698