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

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: Rebase 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 8967cc5f14e09fc2edddc1f4d3e2d960cab0d579..5f7ac3b383d4605f7a18f9e6442e02bf6d7adb76 100644
--- a/components/autofill/core/browser/autofill_field.cc
+++ b/components/autofill/core/browser/autofill_field.cc
@@ -506,15 +506,21 @@ AutofillType AutofillField::Type() const {
if (server_type_ != NO_SERVER_DATA) {
// See http://crbug.com/429236 for background on why we might not always
// believe the server.
- // See http://crbug.com/441488 for potential improvements to the server
- // which may obviate the need for this logic.
+ // TODO(http://crbug.com/589129) investigate how well the server is doing in
+ // regard to credit card predictions.
bool believe_server =
- !(server_type_ == NAME_FULL && heuristic_type_ == CREDIT_CARD_NAME) &&
- !(server_type_ == CREDIT_CARD_NAME && heuristic_type_ == NAME_FULL) &&
+ !(server_type_ == NAME_FULL &&
+ heuristic_type_ == CREDIT_CARD_NAME_FULL) &&
+ !(server_type_ == CREDIT_CARD_NAME_FULL &&
+ 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