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

Unified Diff: components/autofill/core/browser/credit_card.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/credit_card.cc
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index 9083b4035b18829a2ae6e12c398c69b8ebce2c8b..738558679cefc25350665de16c76d78df287c34e 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -22,6 +22,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "components/autofill/core/browser/autofill_data_util.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/validation.h"
@@ -267,6 +268,12 @@ base::string16 CreditCard::GetRawInfo(ServerFieldType type) const {
case CREDIT_CARD_NAME:
return name_on_card_;
+ case CREDIT_CARD_NAME_FIRST:
+ return data_util::SplitName(name_on_card_).given;
+
+ case CREDIT_CARD_NAME_LAST:
+ return data_util::SplitName(name_on_card_).family;
+
case CREDIT_CARD_EXP_MONTH:
return ExpirationMonthAsString();

Powered by Google App Engine
This is Rietveld 408576698