Chromium Code Reviews| Index: components/autofill/core/common/autofill_data_validation.cc |
| diff --git a/components/autofill/core/common/autofill_data_validation.cc b/components/autofill/core/common/autofill_data_validation.cc |
| index c8f6584a430db08e33717e4c7234fe35c7d62bdc..27e3d83b0e41628c4cce822626940af44ff46d5a 100644 |
| --- a/components/autofill/core/common/autofill_data_validation.cc |
| +++ b/components/autofill/core/common/autofill_data_validation.cc |
| @@ -58,9 +58,17 @@ bool IsValidFormData(const FormData& form) { |
| return true; |
| } |
| +bool IsValidPasswordFormData(const PasswordFormFillData& form) { |
|
Ilya Sherman
2014/11/04 23:05:31
If you wanted to factor out this function, it woul
Pritam Nikam
2014/11/05 05:58:14
Done.
|
| + if (!IsValidString16(form.name) || !IsValidGURL(form.origin) || |
| + !IsValidGURL(form.action)) |
| + return false; |
| + |
| + return IsValidFormFieldData(form.username_field) && |
| + IsValidFormFieldData(form.password_field); |
| +} |
| + |
| bool IsValidPasswordFormFillData(const PasswordFormFillData& form) { |
| - if (!IsValidFormData(form.basic_data) || |
| - !IsValidString(form.preferred_realm)) |
| + if (!IsValidPasswordFormData(form) || !IsValidString(form.preferred_realm)) |
| return false; |
| for (PasswordFormFillData::LoginCollection::const_iterator it = |