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

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

Issue 2746033004: Add password form search using blink::WebNode reference comparison. (Closed)
Patch Set: 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
Index: components/autofill/content/renderer/form_autofill_util.cc
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index 9677f8c184a7bfb23fe3f38e50ed461c3b9d9150..deea51c1a8332eb1af0000ac9a48106a25b40298 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -1203,6 +1203,7 @@ bool ExtractFormData(const WebFormElement& form_element, FormData* data) {
}
bool IsFormVisible(blink::WebFrame* frame,
+ const blink::WebFormElement& form_element,
const GURL& canonical_action,
const GURL& canonical_origin,
const FormData& form_data) {
@@ -1232,6 +1233,11 @@ bool IsFormVisible(blink::WebFrame* frame,
if (action_is_empty != form_action_is_empty)
continue;
+ // Try to match the WebFormElement reference first.
dvadym 2017/03/14 17:11:10 I think it's better to move up these lines before
sense (YandexTeam) 2017/03/15 04:51:24 Yes, I agree.
+ if (!form_element.isNull() && form.equals(form_element)) {
dvadym 2017/03/14 17:11:10 Nit: you can use == operator (form == form_element
+ return true; // Form still exists.
+ }
+
if (action_is_empty) { // Both actions are empty, compare all fields.
FormData extracted_form_data;
WebFormElementToFormData(form, WebFormControlElement(), nullptr,

Powered by Google App Engine
This is Rietveld 408576698