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 18:09:24 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-05 18:09:24 +0000
commitfa3fb0cad74e8eeb76547358f62dc87f8327f447 (patch)
tree95664813499a76928161d3128341d53001c1e7f2 /chrome/browser/autofill/credit_card_field.cc
parent71083793e070c4bdf8eb50fd9771b960fb321491 (diff)
downloadchromium_src-fa3fb0cad74e8eeb76547358f62dc87f8327f447.zip
chromium_src-fa3fb0cad74e8eeb76547358f62dc87f8327f447.tar.gz
chromium_src-fa3fb0cad74e8eeb76547358f62dc87f8327f447.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. BUG=38320 TEST=CreditCardFieldTest, FormStructureTest, manual testing with cc.html (attached). Review URL: http://codereview.chromium.org/1518017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43627 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;