OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/credit_card_field.h" | 5 #include "components/autofill/core/browser/credit_card_field.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 if (ParseField(scanner, name_pattern, &credit_card_field->cardholder_)) | 53 if (ParseField(scanner, name_pattern, &credit_card_field->cardholder_)) |
54 continue; | 54 continue; |
55 | 55 |
56 // As a hard-coded hack for Expedia's billing pages (expedia_checkout.html | 56 // As a hard-coded hack for Expedia's billing pages (expedia_checkout.html |
57 // and ExpediaBilling.html in our test suite), recognize separate fields | 57 // and ExpediaBilling.html in our test suite), recognize separate fields |
58 // for the cardholder's first and last name if they have the labels "cfnm" | 58 // for the cardholder's first and last name if they have the labels "cfnm" |
59 // and "clnm". | 59 // and "clnm". |
60 scanner->SaveCursor(); | 60 scanner->SaveCursor(); |
61 const AutofillField* first; | 61 AutofillField* first; |
62 if (ParseField(scanner, base::ASCIIToUTF16("^cfnm"), &first) && | 62 if (ParseField(scanner, base::ASCIIToUTF16("^cfnm"), &first) && |
63 ParseField(scanner, base::ASCIIToUTF16("^clnm"), | 63 ParseField(scanner, base::ASCIIToUTF16("^clnm"), |
64 &credit_card_field->cardholder_last_)) { | 64 &credit_card_field->cardholder_last_)) { |
65 credit_card_field->cardholder_ = first; | 65 credit_card_field->cardholder_ = first; |
66 continue; | 66 continue; |
67 } | 67 } |
68 scanner->Rewind(); | 68 scanner->Rewind(); |
69 } | 69 } |
70 | 70 |
71 // Check for a credit card type (Visa, MasterCard, etc.) field. | 71 // Check for a credit card type (Visa, MasterCard, etc.) field. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 ok = ok && AddClassification(expiration_year_, | 221 ok = ok && AddClassification(expiration_year_, |
222 CREDIT_CARD_EXP_4_DIGIT_YEAR, | 222 CREDIT_CARD_EXP_4_DIGIT_YEAR, |
223 map); | 223 map); |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 return ok; | 227 return ok; |
228 } | 228 } |
229 | 229 |
230 } // namespace autofill | 230 } // namespace autofill |
OLD | NEW |