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

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

Issue 22009003: [Autofill] Distinguish between native field types and potentially HTML field types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 4 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_field.cc
diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc
index 9e72054792e900d349acf3755d05f0ddb893d657..5d192324000f6c0d00f1ad79f16b5797903b2c76 100644
--- a/components/autofill/core/browser/autofill_field.cc
+++ b/components/autofill/core/browser/autofill_field.cc
@@ -8,6 +8,7 @@
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "components/autofill/core/browser/autofill_type.h"
namespace {
@@ -44,7 +45,7 @@ AutofillField::AutofillField(const FormFieldData& field,
AutofillField::~AutofillField() {}
-void AutofillField::set_heuristic_type(AutofillFieldType type) {
+void AutofillField::set_heuristic_type(ServerFieldType type) {
if (type >= 0 && type < MAX_VALID_FIELD_TYPE &&
type != FIELD_WITH_DEFAULT_VALUE) {
heuristic_type_ = type;
@@ -56,7 +57,7 @@ void AutofillField::set_heuristic_type(AutofillFieldType type) {
}
}
-void AutofillField::set_server_type(AutofillFieldType type) {
+void AutofillField::set_server_type(ServerFieldType type) {
// Chrome no longer supports fax numbers, but the server still does.
if (type >= PHONE_FAX_NUMBER && type <= PHONE_FAX_WHOLE_NUMBER)
return;
@@ -64,11 +65,11 @@ void AutofillField::set_server_type(AutofillFieldType type) {
server_type_ = type;
}
-AutofillFieldType AutofillField::type() const {
+AutofillType AutofillField::Type() const {
if (server_type_ != NO_SERVER_DATA)
- return server_type_;
+ return AutofillType(server_type_);
- return heuristic_type_;
+ return AutofillType(heuristic_type_);
}
bool AutofillField::IsEmpty() const {
@@ -82,7 +83,7 @@ std::string AutofillField::FieldSignature() const {
}
bool AutofillField::IsFieldFillable() const {
- return type() != UNKNOWN_TYPE;
+ return Type().server_type() != UNKNOWN_TYPE;
}
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autofill_field.h ('k') | components/autofill/core/browser/autofill_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698