Commit bc7acfc2 authored by estade's avatar estade Committed by Commit bot

Autofill - fix for Lowes mobile checkout cc form

Recognize input type="password" for CVC field

BUG=429343

Review URL: https://codereview.chromium.org/694073002

Cr-Commit-Position: refs/heads/master@{#302467}
parent eb25b2a8
UNKNOWN_TYPE | paymentMethod | | | paymentMethod_1-default CREDIT_CARD_TYPE | paymentMethod | | | paymentMethod_1-cc
UNKNOWN_TYPE | cardNumber | Credit card number | | paymentMethod_1-default CREDIT_CARD_NUMBER | cardNumber | Credit card number | | paymentMethod_1-cc
UNKNOWN_TYPE | sCode | Security Code | | paymentMethod_1-default CREDIT_CARD_VERIFICATION_CODE | sCode | Security Code | | paymentMethod_1-cc
UNKNOWN_TYPE | cardExpiryMonth | | | paymentMethod_1-default CREDIT_CARD_EXP_MONTH | cardExpiryMonth | | | paymentMethod_1-cc
UNKNOWN_TYPE | cardExpiryYear | | | paymentMethod_1-default CREDIT_CARD_EXP_4_DIGIT_YEAR | cardExpiryYear | | | paymentMethod_1-cc
...@@ -75,7 +75,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) { ...@@ -75,7 +75,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) {
if (!credit_card_field->verification_ && if (!credit_card_field->verification_ &&
ParseFieldSpecifics(scanner, ParseFieldSpecifics(scanner,
base::UTF8ToUTF16(autofill::kCardCvcRe), base::UTF8ToUTF16(autofill::kCardCvcRe),
MATCH_DEFAULT | MATCH_TELEPHONE, MATCH_DEFAULT | MATCH_TELEPHONE | MATCH_PASSWORD,
&credit_card_field->verification_)) { &credit_card_field->verification_)) {
continue; continue;
} }
......
...@@ -186,6 +186,9 @@ bool FormField::MatchesFormControlType(const std::string& type, ...@@ -186,6 +186,9 @@ bool FormField::MatchesFormControlType(const std::string& type,
if ((match_type & MATCH_TEXT_AREA) && type == "textarea") if ((match_type & MATCH_TEXT_AREA) && type == "textarea")
return true; return true;
if ((match_type & MATCH_PASSWORD) && type == "password")
return true;
return false; return false;
} }
......
...@@ -44,9 +44,10 @@ class FormField { ...@@ -44,9 +44,10 @@ class FormField {
MATCH_TELEPHONE = 1 << 5, MATCH_TELEPHONE = 1 << 5,
MATCH_SELECT = 1 << 6, MATCH_SELECT = 1 << 6,
MATCH_TEXT_AREA = 1 << 7, MATCH_TEXT_AREA = 1 << 7,
MATCH_PASSWORD = 1 << 8,
MATCH_ALL_INPUTS = MATCH_ALL_INPUTS =
MATCH_TEXT | MATCH_EMAIL | MATCH_TELEPHONE | MATCH_SELECT | MATCH_TEXT | MATCH_EMAIL | MATCH_TELEPHONE | MATCH_SELECT |
MATCH_TEXT_AREA, MATCH_TEXT_AREA | MATCH_PASSWORD,
// By default match label and name for input/text types. // By default match label and name for input/text types.
MATCH_DEFAULT = MATCH_LABEL | MATCH_NAME | MATCH_VALUE | MATCH_TEXT, MATCH_DEFAULT = MATCH_LABEL | MATCH_NAME | MATCH_VALUE | MATCH_TEXT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment