Index: chrome/browser/autofill/form_structure.cc |
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc |
index 87c48f07c1eb19f58585f6c88584c1d640212970..35e2f90eeff71dc065c139850588e2c0a65d2b32 100644 |
--- a/chrome/browser/autofill/form_structure.cc |
+++ b/chrome/browser/autofill/form_structure.cc |
@@ -522,7 +522,7 @@ bool FormStructure::IsAutofillable(bool require_method_post) const { |
// TODO(ramankk): Remove this check once we have better way of identifying the |
// cases to trigger experimental form filling. |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableExperimentalFormFilling)) |
+ switches::kEnableExperimentalFormFilling)) |
return true; |
if (autofill_count() < kRequiredFillableFields) |
@@ -545,7 +545,7 @@ bool FormStructure::ShouldBeParsed(bool require_method_post) const { |
// TODO(ramankk): Remove this check once we have better way of identifying the |
// cases to trigger experimental form filling. |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableExperimentalFormFilling)) |
+ switches::kEnableExperimentalFormFilling)) |
return true; |
if (field_count() < kRequiredFillableFields) |
@@ -814,6 +814,21 @@ std::string FormStructure::server_experiment_id() const { |
return server_experiment_id_; |
} |
+FormData FormStructure::ToFormData() const { |
+ // |data.user_submitted| will always be false. |
+ FormData data; |
+ data.name = form_name_; |
+ data.origin = source_url_; |
+ data.action = target_url_; |
+ data.method = ASCIIToUTF16(method_ == POST ? "POST" : "GET"); |
+ |
+ for (size_t i = 0; i < fields_.size(); ++i) { |
+ data.fields.push_back(FormFieldData(*fields_[i])); |
+ } |
+ |
+ return data; |
+} |
+ |
bool FormStructure::operator==(const FormData& form) const { |
// TODO(jhawkins): Is this enough to differentiate a form? |
if (form_name_ == form.name && |