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

Unified Diff: components/password_manager/content/browser/content_password_manager_driver.cc

Issue 2754033002: Fix the position of AutofillClient for PasswordAutofillManager when the focused form element is ins… (Closed)
Patch Set: Fixing a compile error Created 3 years, 9 months 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
« no previous file with comments | « components/password_manager/content/browser/content_password_manager_driver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/content/browser/content_password_manager_driver.cc
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc
index ebf591eba28d1eafbd05664bb1316650c43502fa..0c26839db266ca1d773667a0a5ec1b2d7224ce70 100644
--- a/components/password_manager/content/browser/content_password_manager_driver.cc
+++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -20,6 +20,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/ssl_status.h"
#include "content/public/browser/web_contents.h"
@@ -282,13 +283,15 @@ void ContentPasswordManagerDriver::ShowPasswordSuggestions(
int options,
const gfx::RectF& bounds) {
password_autofill_manager_.OnShowPasswordSuggestions(
- key, text_direction, typed_username, options, bounds);
+ key, text_direction, typed_username, options,
+ TransformToRootCoordinates(bounds));
}
void ContentPasswordManagerDriver::ShowNotSecureWarning(
base::i18n::TextDirection text_direction,
const gfx::RectF& bounds) {
- password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds);
+ password_autofill_manager_.OnShowNotSecureWarning(
+ text_direction, TransformToRootCoordinates(bounds));
}
void ContentPasswordManagerDriver::RecordSavePasswordProgress(
@@ -344,4 +347,14 @@ ContentPasswordManagerDriver::GetPasswordGenerationAgent() {
return password_gen_agent_;
}
+gfx::RectF ContentPasswordManagerDriver::TransformToRootCoordinates(
+ const gfx::RectF& bounds_in_frame_coordinates) {
+ content::RenderWidgetHostView* rwhv = render_frame_host_->GetView();
+ if (!rwhv)
+ return bounds_in_frame_coordinates;
+ return gfx::RectF(rwhv->TransformPointToRootCoordSpaceF(
+ bounds_in_frame_coordinates.origin()),
+ bounds_in_frame_coordinates.size());
+}
+
} // namespace password_manager
« no previous file with comments | « components/password_manager/content/browser/content_password_manager_driver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698