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

Unified Diff: components/autofill/core/common/autofill_data_validation.cc

Issue 614023002: [Password manager] Relplace the FormFieldData vector from autofill::FormData with named fields… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed FormData from PasswordFormFillData. Created 6 years, 1 month 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/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 =

Powered by Google App Engine
This is Rietveld 408576698