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

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

Issue 1694443004: [Autofill] Add credit card first and last name heuristics predictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 754ec0175be74bfcf416f6c51d84048fdc0f2eaf..47ababd2c0b063b1e354b48191a85dd4e7d114b0 100644
--- a/components/autofill/core/browser/autofill_field.cc
+++ b/components/autofill/core/browser/autofill_field.cc
@@ -504,10 +504,14 @@ AutofillType AutofillField::Type() const {
bool believe_server =
!(server_type_ == NAME_FULL && heuristic_type_ == CREDIT_CARD_NAME) &&
!(server_type_ == CREDIT_CARD_NAME && heuristic_type_ == NAME_FULL) &&
+ !(server_type_ == NAME_FIRST &&
+ heuristic_type_ == CREDIT_CARD_NAME_FIRST) &&
+ !(server_type_ == NAME_LAST &&
+ heuristic_type_ == CREDIT_CARD_NAME_LAST) &&
// CVC is sometimes type="password", which tricks the server.
// See http://crbug.com/469007
!(AutofillType(server_type_).group() == PASSWORD_FIELD &&
- heuristic_type_ == CREDIT_CARD_VERIFICATION_CODE);
+ heuristic_type_ == CREDIT_CARD_VERIFICATION_CODE);
if (believe_server)
return AutofillType(server_type_);
}

Powered by Google App Engine
This is Rietveld 408576698