Chromium Code Reviews| 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..dbbacc5dffa388d38d6e61877e3a8e701d90e9cb 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_; |
| } |
| +void FormStructure::ToFormData(FormData* out_data) const { |
| + // |data->user_submitted| will always be false. |
| + scoped_ptr<FormData> data(new FormData); |
| + data->name = form_name_; |
| + data->origin = source_url_; |
| + data->action = target_url_; |
| + data->method = method_; |
|
Ilya Sherman
2012/11/29 00:08:59
Why not just directly set the members of |out_data
Dan Beam
2012/11/29 00:51:13
Changed to passing value rather than using out par
|
| + |
| + for (size_t i = 0; i < fields_.size(); ++i) { |
| + data->fields.push_back(FormFieldData(*fields_[i])); |
| + } |
| + |
| + out_data = data.release(); |
|
Evan Stade
2012/11/28 22:45:51
this doesn't do anything
Dan Beam
2012/11/29 00:51:13
Thanks for the explanation.
|
| +} |
| + |
| bool FormStructure::operator==(const FormData& form) const { |
| // TODO(jhawkins): Is this enough to differentiate a form? |
| if (form_name_ == form.name && |