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

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

Issue 1583563003: [Autofill] Parse forms that have autocomplete attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed android compile and browser test Created 4 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/autofill_type.cc
diff --git a/components/autofill/core/browser/autofill_type.cc b/components/autofill/core/browser/autofill_type.cc
index c0266ec44b2371782199ae22e737a66f93ed7232..71d49558bc902404652a1743e157f1ffd61b0782 100644
--- a/components/autofill/core/browser/autofill_type.cc
+++ b/components/autofill/core/browser/autofill_type.cc
@@ -9,8 +9,7 @@
namespace autofill {
AutofillType::AutofillType(ServerFieldType field_type)
- : html_type_(HTML_TYPE_UNKNOWN),
- html_mode_(HTML_MODE_NONE) {
+ : html_type_(HTML_TYPE_UNSPECIFIED), html_mode_(HTML_MODE_NONE) {
if ((field_type < NO_SERVER_DATA || field_type >= MAX_VALID_FIELD_TYPE) ||
(field_type >= 15 && field_type <= 19) ||
(field_type >= 25 && field_type <= 29) ||
@@ -201,7 +200,8 @@ FieldTypeGroup AutofillType::group() const {
case HTML_TYPE_EMAIL:
return EMAIL;
- case HTML_TYPE_UNKNOWN:
+ case HTML_TYPE_UNSPECIFIED:
+ case HTML_TYPE_UNRECOGNIZED:
break;
}
@@ -209,7 +209,8 @@ FieldTypeGroup AutofillType::group() const {
}
bool AutofillType::IsUnknown() const {
- return server_type_ == UNKNOWN_TYPE && html_type_ == HTML_TYPE_UNKNOWN;
+ return server_type_ == UNKNOWN_TYPE && (html_type_ == HTML_TYPE_UNSPECIFIED ||
+ html_type_ == HTML_TYPE_UNRECOGNIZED);
}
ServerFieldType AutofillType::GetStorableType() const {
@@ -289,7 +290,7 @@ ServerFieldType AutofillType::GetStorableType() const {
}
switch (html_type_) {
- case HTML_TYPE_UNKNOWN:
+ case HTML_TYPE_UNSPECIFIED:
return UNKNOWN_TYPE;
case HTML_TYPE_NAME:
@@ -399,6 +400,9 @@ ServerFieldType AutofillType::GetStorableType() const {
case HTML_TYPE_TRANSACTION_AMOUNT:
case HTML_TYPE_TRANSACTION_CURRENCY:
return UNKNOWN_TYPE;
+
+ case HTML_TYPE_UNRECOGNIZED:
+ return UNKNOWN_TYPE;
}
NOTREACHED();
@@ -636,7 +640,7 @@ std::string AutofillType::ToString() const {
}
switch (html_type_) {
- case HTML_TYPE_UNKNOWN:
+ case HTML_TYPE_UNSPECIFIED:
NOTREACHED();
break;
case HTML_TYPE_NAME:
@@ -715,6 +719,8 @@ std::string AutofillType::ToString() const {
return "HTML_TRANSACTION_AMOUNT";
case HTML_TYPE_TRANSACTION_CURRENCY:
return "HTML_TRANSACTION_CURRENCY";
+ case HTML_TYPE_UNRECOGNIZED:
+ return "HTML_TYPE_UNRECOGNIZED";
}
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698