From 0a8abd1cd85e42b969740ca38e01df01ff244743 Mon Sep 17 00:00:00 2001 From: sebsg Date: Tue, 1 Mar 2016 12:45:03 -0800 Subject: Added two new field types : CREDIT_CARD_NAME_FIRST and CREDIT_CARD_NAME_LAST. Modified the heuristics to recognize these two new fields. Added code to be able to fill these new fields with the data already available. This will fix Keurig.com and sites like this example: https://f117f41fdbc2c18ce6861c4fac2e807ecf7f1d75.googledrive.com/host/0B3xzZ-vFr2LRU0FlVEhGa09uSDA Since it's still pretty conservative. It won't fix sites like Cabelas.com where the fields are named "firstname" and "lastname" The original heuristics predictions on Keurig.com were: NAME_FIRST | card_firstNameOnCard | First Name* NAME_LAST | card_lastNameOnCard | Last Name* UNKNOWN_TYPE | card_accountNumber | Card Number* UNKNOWN_TYPE | card_cardType | Card Type UNKNOWN_TYPE | | Please select a card type UNKNOWN_TYPE | card_expirationMonth | Expiration Date* UNKNOWN_TYPE | | Month CREDIT_CARD_EXP_MONTH | card_expirationYear | Expiration Date* CREDIT_CARD_EXP_4_DIGIT_YEAR | | Year | CREDIT_CARD_VERIFICATION_CODE | card_cvNumber | Security Code* TBR=thestig@chromium.org BUG=579174 TEST=AutofillManagerTest, FormStructureTest Review URL: https://codereview.chromium.org/1694443004 Cr-Commit-Position: refs/heads/master@{#378551} --- chrome/browser/autofill/autofill_browsertest.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'chrome/browser/autofill/autofill_browsertest.cc') diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index 2e0c077..526b72c 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -364,7 +364,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, FillProfileCrazyCharacters) { std::vector cards; CreditCard card1; - card1.SetRawInfo(CREDIT_CARD_NAME, + card1.SetRawInfo(CREDIT_CARD_NAME_FULL, WideToUTF16(L"\u751f\u6d3b\u5f88\u6709\u89c4\u5f8b " L"\u4ee5\u73a9\u4e3a\u4e3b")); card1.SetRawInfo(CREDIT_CARD_NUMBER, WideToUTF16(L"6011111111111117")); @@ -373,14 +373,14 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, FillProfileCrazyCharacters) { cards.push_back(card1); CreditCard card2; - card2.SetRawInfo(CREDIT_CARD_NAME, WideToUTF16(L"John Williams")); + card2.SetRawInfo(CREDIT_CARD_NAME_FULL, WideToUTF16(L"John Williams")); card2.SetRawInfo(CREDIT_CARD_NUMBER, WideToUTF16(L"WokoAwesome12345")); card2.SetRawInfo(CREDIT_CARD_EXP_MONTH, WideToUTF16(L"10")); card2.SetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR, WideToUTF16(L"2015")); cards.push_back(card2); CreditCard card3; - card3.SetRawInfo(CREDIT_CARD_NAME, + card3.SetRawInfo(CREDIT_CARD_NAME_FULL, WideToUTF16(L"\u0623\u062d\u0645\u062f\u064a " L"\u0646\u062c\u0627\u062f " L"\u0644\u0645\u062d\u0627\u0648\u0644\u0647 " @@ -396,7 +396,7 @@ IN_PROC_BROWSER_TEST_F(AutofillTest, FillProfileCrazyCharacters) { cards.push_back(card3); CreditCard card4; - card4.SetRawInfo(CREDIT_CARD_NAME, + card4.SetRawInfo(CREDIT_CARD_NAME_FULL, WideToUTF16(L"\u039d\u03ad\u03b5\u03c2 " L"\u03c3\u03c5\u03b3\u03c7\u03c9\u03bd\u03b5" L"\u03cd\u03c3\u03b5\u03b9\u03c2 " -- cgit v1.1