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

Issue 1001193002: Autofill: Better recognize credit card fields. (Closed)

Created:
5 years, 9 months ago by Lei Zhang
Modified:
4 years ago
Reviewers:
Evan Stade
CC:
chromium-reviews, estade+watch_chromium.org, rouslan+autofillwatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Autofill: Better recognize credit card fields. Based on field attributes, oftentimes it is very likely a field is a given type, while its name or label may be ambiguous. BUG=464002, 466685

Patch Set 1 : before #

Patch Set 2 : after #

Total comments: 10

Patch Set 3 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+367 lines, -51 lines) Patch
A chrome/test/data/autofill/heuristics/input/bug_464002.html View 1 chunk +244 lines, -0 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/bug_463986.out View 1 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/autofill/heuristics/output/bug_464002.out View 1 1 chunk +7 lines, -0 lines 0 comments Download
M components/autofill/core/browser/autofill_field.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M components/autofill/core/browser/autofill_field.cc View 1 2 3 chunks +21 lines, -20 lines 0 comments Download
M components/autofill/core/browser/autofill_regex_constants.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M components/autofill/core/browser/autofill_regex_constants.cc.utf8 View 1 2 chunks +0 lines, -4 lines 0 comments Download
M components/autofill/core/browser/credit_card_field.h View 1 1 chunk +13 lines, -0 lines 0 comments Download
M components/autofill/core/browser/credit_card_field.cc View 1 2 6 chunks +64 lines, -17 lines 0 comments Download
M components/autofill/core/browser/credit_card_field_unittest.cc View 1 2 chunks +7 lines, -4 lines 0 comments Download
M components/autofill/core/browser/form_field.h View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
Lei Zhang
https://codereview.chromium.org/1001193002/diff/40001/chrome/test/data/autofill/heuristics/output/bug_463986.out File chrome/test/data/autofill/heuristics/output/bug_463986.out (right): https://codereview.chromium.org/1001193002/diff/40001/chrome/test/data/autofill/heuristics/output/bug_463986.out#newcode21 chrome/test/data/autofill/heuristics/output/bug_463986.out:21: UNKNOWN_TYPE | accountBrandDropDown | Card Brand | | salutation_1-default ...
5 years, 9 months ago (2015-03-13 08:15:11 UTC) #3
Evan Stade
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/core/browser/credit_card_field.cc File components/autofill/core/browser/credit_card_field.cc (right): https://codereview.chromium.org/1001193002/diff/40001/components/autofill/core/browser/credit_card_field.cc#newcode50 components/autofill/core/browser/credit_card_field.cc:50: !LikelyCardNumberField(scanner) && Why are you checking !LikelyCardNumberField in several ...
5 years, 9 months ago (2015-03-13 20:57:13 UTC) #4
Lei Zhang
5 years, 9 months ago (2015-03-13 23:11:01 UTC) #5
https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
File components/autofill/core/browser/credit_card_field.cc (right):

https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:50:
!LikelyCardNumberField(scanner) &&
On 2015/03/13 20:57:13, Evan Stade wrote:
> Why are you checking !LikelyCardNumberField in several places, as opposed to,
> say, moving the card number matcher earlier in the loop?

Changing the order may creates more of the same problem. Instead of incorrectly
recognizing a name as a number, we may end up incorrectly recgonzing a number as
a name. The order we have seem to work well for most cases, so I don't want to
change it. I just want to make it more accurate. The !LikelyFoo() calls act as
filters to help decrease false positives.

https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:75: // but
LikelyCardType() works as well and produces fewer incorrect matches.
On 2015/03/13 20:57:13, Evan Stade wrote:
> this extra documentation is perhaps relevant to this code review but I'd not
> leave it in the code

Removed.

https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:168: // Look for a form of
the right type with a 16 to 19 digit maxlength.
On 2015/03/13 20:57:13, Evan Stade wrote:
> the minimum card has less than 16 digits

Yes, but if a website made it less than 16, then they can't accept a
VISA/Mastercard CC number.

https://codereview.chromium.org/1001193002/diff/40001/components/autofill/cor...
components/autofill/core/browser/credit_card_field.cc:181: if
(MatchesFormControlType(field->form_control_type, MATCH_SELECT)) {
On 2015/03/13 20:57:13, Evan Stade wrote:
> I feel like this code should go somewhere we can reuse it for address pieces
> 
> Also you should reuse/share with the filling code, i.e.
> FillCreditCardTypeSelectControl

Done.

Powered by Google App Engine
This is Rietveld 408576698