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

Unified Diff: components/autofill/content/renderer/password_generation_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_generation_agent.cc
diff --git a/components/autofill/content/renderer/password_generation_agent.cc b/components/autofill/content/renderer/password_generation_agent.cc
index 6ad50b527be8be544cd6d4b5df2c72cf4636d739..62ba413c091a7d3edb9c3b10ca19ef2b730e368d 100644
--- a/components/autofill/content/renderer/password_generation_agent.cc
+++ b/components/autofill/content/renderer/password_generation_agent.cc
@@ -18,6 +18,7 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
#include "google_apis/gaia/gaia_urls.h"
+#include "third_party/WebKit/public/platform/WebFloatRect.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFormElement.h"
@@ -411,23 +412,19 @@ bool PasswordGenerationAgent::TextDidChangeInTextField(
}
void PasswordGenerationAgent::ShowGenerationPopup() {
- blink::WebRect bounding_box_in_window =
- generation_element_.boundsInViewport();
- render_frame()->GetRenderView()->convertViewportToWindow(
- &bounding_box_in_window);
-
+ blink::WebFloatRect bounding_box_in_window;
+ render_frame()->GetRenderView()->getElementBoundingBoxWindow(
+ &generation_element_, &bounding_box_in_window);
Send(new AutofillHostMsg_ShowPasswordGenerationPopup(
routing_id(), gfx::RectF(bounding_box_in_window),
generation_element_.maxLength(), *generation_form_data_->form));
-
generation_popup_shown_ = true;
}
void PasswordGenerationAgent::ShowEditingPopup() {
- blink::WebRect bounding_box_in_window =
- generation_element_.boundsInViewport();
- render_frame()->GetRenderView()->convertViewportToWindow(
- &bounding_box_in_window);
+ blink::WebFloatRect bounding_box_in_window;
+ render_frame()->GetRenderView()->getElementBoundingBoxWindow(
+ &generation_element_, &bounding_box_in_window);
Send(new AutofillHostMsg_ShowPasswordEditingPopup(
routing_id(), gfx::RectF(bounding_box_in_window),
*generation_form_data_->form));
« no previous file with comments | « components/autofill/content/renderer/password_autofill_agent.cc ('k') | content/public/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698