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

Unified Diff: components/autofill/content/renderer/autofill_agent.h

Issue 2065303002: Modifying Autofill Agent to use synthetic form (i.e., formless elements) when no form is present on… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding more tests Created 4 years, 6 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/autofill_agent.h
diff --git a/components/autofill/content/renderer/autofill_agent.h b/components/autofill/content/renderer/autofill_agent.h
index 0de9b5cb8138344a034f76c4e3a07040940ba77f..e6863f3464637e2deadee3eeccf2b6f03e2b76dc 100644
--- a/components/autofill/content/renderer/autofill_agent.h
+++ b/components/autofill/content/renderer/autofill_agent.h
@@ -188,6 +188,11 @@ class AutofillAgent : public content::RenderFrameObserver,
// Called when a same-page navigation is detected.
void OnSamePageNavigationCompleted();
+ // Helper method which collects unowned elements (i.e., those not inside a
+ // form tag) and writes them into |output|. Returns true if the process is
+ // successful, and all conditions for firing events are true.
+ bool CollectFormlessElements(FormData* output);
+ FRIEND_TEST_ALL_PREFIXES(FormAutocompleteTest, CollectFormlessElements);
// Called in a posted task by textFieldDidChange() to work-around a WebKit bug
// http://bugs.webkit.org/show_bug.cgi?id=16976
@@ -270,6 +275,10 @@ class AutofillAgent : public content::RenderFrameObserver,
// Last form which was interacted with by the user.
blink::WebFormElement last_interacted_form_;
+ // When dealing with forms that don't use a <form> tag, we keep track of the
+ // elements the user has modified so we can determine when submission occurs.
+ std::set<blink::WebFormControlElement> formless_elements_user_edited_;
+
// Was the query node autofilled prior to previewing the form?
bool was_query_node_autofilled_;
« no previous file with comments | « chrome/renderer/autofill/form_autocomplete_browsertest.cc ('k') | components/autofill/content/renderer/autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698