summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/credit_card_field.cc
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-05 20:54:13 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-05 20:54:13 +0000
commitada32fe1849e988ff0000d493695f94aee184bc4 (patch)
treeae1b285ec1b1bbb2a3a7177c6b9eec8878409ef3 /chrome/browser/autofill/credit_card_field.cc
parent30d07443a806097199ff736e2e8009ce1b59a14d (diff)
downloadchromium_src-ada32fe1849e988ff0000d493695f94aee184bc4.zip
chromium_src-ada32fe1849e988ff0000d493695f94aee184bc4.tar.gz
chromium_src-ada32fe1849e988ff0000d493695f94aee184bc4.tar.bz2
AutoFill credit card field filling, with nameoncard field.
Enables credit card filling when "Name on Card" field is present. This adds to existing method of clicking on card number to fill. Note: this fixes up unit test changes with recent migration to FormData from FormFieldValues. BUG=38320 TEST=CreditCardFieldTest, FormStructureTest, manual testing with cc.html (attached). Related to: http://codereview.chromium.org/1518017 http://codereview.chromium.org/1605011 Review URL: http://codereview.chromium.org/1512018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43649 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/credit_card_field.cc')
-rw-r--r--chrome/browser/autofill/credit_card_field.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/autofill/credit_card_field.cc b/chrome/browser/autofill/credit_card_field.cc
index b79467d..95f2f5b 100644
--- a/chrome/browser/autofill/credit_card_field.cc
+++ b/chrome/browser/autofill/credit_card_field.cc
@@ -61,7 +61,7 @@ CreditCardField* CreditCardField::Parse(
} else {
if (fields == 0 || credit_card_field.expiration_month_) {
// at beginning or end
- name_pattern = ASCIIToUTF16("card holder|name on card");
+ name_pattern = ASCIIToUTF16("card holder|name on card|nameoncard");
} else {
name_pattern = ASCIIToUTF16("name");
}
@@ -152,7 +152,10 @@ CreditCardField* CreditCardField::Parse(
// Some pages (e.g. ExpediaBilling.html) have a "card description"
// field; we parse this field but ignore it.
- if (ParseText(&q, ASCIIToUTF16("card description")))
+ // We also ignore any other fields within a credit card block that
+ // start with "card", under the assumption that they are related to
+ // the credit card section being processed but are uninteresting to us.
+ if (ParseText(&q, ASCIIToUTF16("^card")))
continue;
break;