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

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

Issue 2746033004: Add password form search using blink::WebNode reference comparison. (Closed)
Patch Set: Rename ProvisionallySavedForm to ProvisionallySavedPasswordForm. 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..51c745fdb5253cc1f0c28c746ea1f677beb2a098 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) {
@@ -1226,6 +1227,11 @@ bool IsFormVisible(blink::WebFrame* frame,
if (!AreFormContentsVisible(form))
continue;
+ // Try to match the WebFormElement reference first.
+ if (!form_element.isNull() && form == form_element) {
+ return true; // Form still exists.
+ }
+
GURL iter_canonical_action = GetCanonicalActionForForm(form);
bool form_action_is_empty = iter_canonical_action.is_empty() ||
iter_canonical_action == frame_origin;

Powered by Google App Engine
This is Rietveld 408576698