OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autofill/autofill_field.h" | 10 #include "chrome/browser/autofill/autofill_field.h" |
10 | 11 |
11 bool CreditCardField::GetFieldInfo(FieldTypeMap* field_type_map) const { | 12 bool CreditCardField::GetFieldInfo(FieldTypeMap* field_type_map) const { |
12 bool ok = Add(field_type_map, number_, AutoFillType(CREDIT_CARD_NUMBER)); | 13 bool ok = Add(field_type_map, number_, AutoFillType(CREDIT_CARD_NUMBER)); |
13 DCHECK(ok); | 14 DCHECK(ok); |
14 | 15 |
15 // If the heuristics detected first and last name in separate fields, | 16 // If the heuristics detected first and last name in separate fields, |
16 // then ignore both fields. Putting them into separate fields is probably | 17 // then ignore both fields. Putting them into separate fields is probably |
17 // wrong, because the credit card can also contain a middle name or middle | 18 // wrong, because the credit card can also contain a middle name or middle |
18 // initial. | 19 // initial. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 155 } |
155 | 156 |
156 CreditCardField::CreditCardField() | 157 CreditCardField::CreditCardField() |
157 : cardholder_(NULL), | 158 : cardholder_(NULL), |
158 cardholder_last_(NULL), | 159 cardholder_last_(NULL), |
159 type_(NULL), | 160 type_(NULL), |
160 number_(NULL), | 161 number_(NULL), |
161 expiration_month_(NULL), | 162 expiration_month_(NULL), |
162 expiration_year_(NULL) { | 163 expiration_year_(NULL) { |
163 } | 164 } |
OLD | NEW |