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

Unified Diff: components/autofill/core/browser/phone_field.cc

Issue 853523004: Autofill: Set requirements for number of recognized fields in an autofillable form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More relaxed check for form tag Created 5 years, 11 months 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/browser/phone_field.cc
diff --git a/components/autofill/core/browser/phone_field.cc b/components/autofill/core/browser/phone_field.cc
index d7860497378a55090a40234e907f1c4e39ef0f5a..0f9ff5b0f851ff925094b4fe1bfe9f12a22037af 100644
--- a/components/autofill/core/browser/phone_field.cc
+++ b/components/autofill/core/browser/phone_field.cc
@@ -240,6 +240,16 @@ bool PhoneField::ClassifyField(ServerFieldTypeMap* map) const {
return ok;
}
+size_t PhoneField::FieldCount() const {
Evan Stade 2015/01/21 22:52:50 why not just return 1? Why should three separate i
Lei Zhang 2015/01/22 08:07:37 Recognizing many fields in a phone number is a str
+ size_t count = 0;
+ for (size_t i = 0; i < FIELD_MAX; ++i) {
+ if (parsed_phone_fields_[i])
+ ++count;
+ }
+
+ return count;
+}
+
PhoneField::PhoneField() {
memset(parsed_phone_fields_, 0, sizeof(parsed_phone_fields_));
}

Powered by Google App Engine
This is Rietveld 408576698