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

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

Issue 804443002: Autofill: Modify various utility function to deal with unowned form fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge UnownedFormElementsAndFieldSetsToFormData call into FindFormAndFieldForFormControlElement Created 6 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/form_autofill_util.h
diff --git a/components/autofill/content/renderer/form_autofill_util.h b/components/autofill/content/renderer/form_autofill_util.h
index 66e89cb16c3540ee651a1f6f6c7748a08a7eb80f..030d84123778b6647e34dd6d143385efc04f1491 100644
--- a/components/autofill/content/renderer/form_autofill_util.h
+++ b/components/autofill/content/renderer/form_autofill_util.h
@@ -9,6 +9,7 @@
#include "base/strings/string16.h"
#include "third_party/WebKit/public/platform/WebVector.h"
+#include "third_party/WebKit/public/web/WebElementCollection.h"
#include "ui/gfx/rect.h"
class GURL;
@@ -114,18 +115,31 @@ bool WebFormElementToFormData(
FormData* form,
FormFieldData* field);
+// Get all form control elements from |elements| that are not part of a form.
+// If |fieldsets| is not NULL, also append the fieldsets encountered that are
+// not part of a form.
+std::vector<blink::WebFormControlElement>
+GetUnownedAutofillableFormFieldElements(
+ const blink::WebElementCollection& elements,
+ std::vector<blink::WebElement>* fieldsets);
+
// Fills |form| with the form data derived from |fieldsets|, |control_elements|
-// and |origin|. |extract_mask| usage and the return value are the same as
+// and |origin|. If |field| is non-NULL, fill it with the FormField
+// representation for |element|.
+// |extract_mask| usage and the return value are the same as
// WebFormElementToFormData() above.
bool UnownedFormElementsAndFieldSetsToFormData(
const std::vector<blink::WebElement>& fieldsets,
const std::vector<blink::WebFormControlElement>& control_elements,
+ const blink::WebFormControlElement* element,
const GURL& origin,
+ RequirementsMask requirements,
ExtractMask extract_mask,
- FormData* form);
+ FormData* form,
+ FormFieldData* field);
-// Finds the form that contains |element| and returns it in |form|. Fills
-// |field| with the |FormField| representation for element.
+// Finds the form that contains |element| and returns it in |form|. If |field|
+// is non-NULL, fill it with the FormField representation for |element|.
// Returns false if the form is not found or cannot be serialized.
bool FindFormAndFieldForFormControlElement(
const blink::WebFormControlElement& element,

Powered by Google App Engine
This is Rietveld 408576698