| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/autofill/credit_card_field.h" | 5 #include "chrome/browser/autofill/credit_card_field.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 9 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/autofill/autofill_field.h" | 14 #include "chrome/browser/autofill/autofill_field.h" |
| 15 #include "chrome/browser/autofill/field_types.h" |
| 11 #include "grit/autofill_resources.h" | 16 #include "grit/autofill_resources.h" |
| 12 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 13 | 18 |
| 14 bool CreditCardField::GetFieldInfo(FieldTypeMap* field_type_map) const { | 19 bool CreditCardField::GetFieldInfo(FieldTypeMap* field_type_map) const { |
| 15 bool ok = Add(field_type_map, number_, AutofillType(CREDIT_CARD_NUMBER)); | 20 bool ok = Add(field_type_map, number_, AutofillType(CREDIT_CARD_NUMBER)); |
| 16 DCHECK(ok); | 21 DCHECK(ok); |
| 17 | 22 |
| 18 // If the heuristics detected first and last name in separate fields, | 23 // If the heuristics detected first and last name in separate fields, |
| 19 // then ignore both fields. Putting them into separate fields is probably | 24 // then ignore both fields. Putting them into separate fields is probably |
| 20 // wrong, because the credit card can also contain a middle name or middle | 25 // wrong, because the credit card can also contain a middle name or middle |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 203 |
| 199 CreditCardField::CreditCardField() | 204 CreditCardField::CreditCardField() |
| 200 : cardholder_(NULL), | 205 : cardholder_(NULL), |
| 201 cardholder_last_(NULL), | 206 cardholder_last_(NULL), |
| 202 type_(NULL), | 207 type_(NULL), |
| 203 number_(NULL), | 208 number_(NULL), |
| 204 verification_(NULL), | 209 verification_(NULL), |
| 205 expiration_month_(NULL), | 210 expiration_month_(NULL), |
| 206 expiration_year_(NULL) { | 211 expiration_year_(NULL) { |
| 207 } | 212 } |
| OLD | NEW |