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

Unified Diff: chrome/browser/autofill/credit_card_field.cc

Issue 8052024: Autofill: Ignore gift cards when filling credit card info (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
Index: chrome/browser/autofill/credit_card_field.cc
diff --git a/chrome/browser/autofill/credit_card_field.cc b/chrome/browser/autofill/credit_card_field.cc
index 3f3bb5991b55c62ff853e58dde18e1bd55a9e710..59350eb7b1e3b55fc0cf8d4fa408c18d9902a4ee 100644
--- a/chrome/browser/autofill/credit_card_field.cc
+++ b/chrome/browser/autofill/credit_card_field.cc
@@ -29,6 +29,10 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) {
// We loop until no more credit card related fields are found, see |break| at
// bottom of the loop.
for (int fields = 0; !scanner->IsEnd(); ++fields) {
+ // Ignore gift card fields.
+ if (ParseField(scanner, UTF8ToUTF16(autofill::kGiftCardRe), NULL))
+ break;
+
// Sometimes the cardholder field is just labeled "name". Unfortunately this
// is a dangerously generic word to search for, since it will often match a
// name (not cardholder name) field before or after credit card fields. So
@@ -131,9 +135,8 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner) {
// 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 (ParseField(scanner, UTF8ToUTF16(autofill::kCardIgnoredRe), NULL)) {
+ if (ParseField(scanner, UTF8ToUTF16(autofill::kCardIgnoredRe), NULL))
continue;
- }
break;
}
« no previous file with comments | « chrome/browser/autofill/autofill_regex_constants.cc.utf8 ('k') | chrome/browser/autofill/form_structure_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698