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

Unified Diff: components/autofill/core/browser/credit_card_field.cc

Issue 681843002: Autofill - improve Macy's and Best Buy checkout by parsing input type="tel" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « chrome/test/data/autofill/heuristics/output/21_checkout_m_macys.com.out ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/credit_card_field.cc
diff --git a/components/autofill/core/browser/credit_card_field.cc b/components/autofill/core/browser/credit_card_field.cc
index 85b122f145442c55f87ed22fa8886191632ec831..c0d0c1d535072e0f01a68055d2daca4d6dbbe832 100644
--- a/components/autofill/core/browser/credit_card_field.cc
+++ b/components/autofill/core/browser/credit_card_field.cc
@@ -88,14 +88,21 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) {
// "verification number", "card identification number" and others listed
// in the |pattern| below.
base::string16 pattern = base::UTF8ToUTF16(autofill::kCardCvcRe);
+ // Some sites use type="tel" for numerical inputs.
if (!credit_card_field->verification_ &&
- ParseField(scanner, pattern, &credit_card_field->verification_)) {
+ ParseFieldSpecifics(scanner,
+ pattern,
+ MATCH_DEFAULT | MATCH_TELEPHONE,
+ &credit_card_field->verification_)) {
continue;
}
pattern = base::UTF8ToUTF16(autofill::kCardNumberRe);
AutofillField* current_number_field;
- if (ParseField(scanner, pattern, &current_number_field)) {
+ if (ParseFieldSpecifics(scanner,
+ pattern,
+ MATCH_DEFAULT | MATCH_TELEPHONE,
+ &current_number_field)) {
// Avoid autofilling any credit card number field having very low or high
// |start_index| on the HTML form.
size_t start_index = 0;
« no previous file with comments | « chrome/test/data/autofill/heuristics/output/21_checkout_m_macys.com.out ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698