| 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.h" | 5 #include "chrome/browser/autofill/credit_card.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 label_(label), | 32 label_(label), |
| 33 unique_id_(unique_id) { | 33 unique_id_(unique_id) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 CreditCard::CreditCard(const CreditCard& card) : FormGroup() { | 36 CreditCard::CreditCard(const CreditCard& card) : FormGroup() { |
| 37 operator=(card); | 37 operator=(card); |
| 38 } | 38 } |
| 39 | 39 |
| 40 CreditCard::CreditCard() | 40 CreditCard::CreditCard() |
| 41 : expiration_month_(0), | 41 : expiration_month_(0), |
| 42 expiration_year_(0) { | 42 expiration_year_(0), |
| 43 unique_id_(0) { |
| 43 } | 44 } |
| 44 | 45 |
| 45 FormGroup* CreditCard::Clone() const { | 46 FormGroup* CreditCard::Clone() const { |
| 46 return new CreditCard(*this); | 47 return new CreditCard(*this); |
| 47 } | 48 } |
| 48 | 49 |
| 49 void CreditCard::GetPossibleFieldTypes(const string16& text, | 50 void CreditCard::GetPossibleFieldTypes(const string16& text, |
| 50 FieldTypeSet* possible_types) const { | 51 FieldTypeSet* possible_types) const { |
| 51 if (IsNameOnCard(text)) | 52 if (IsNameOnCard(text)) |
| 52 possible_types->insert(CREDIT_CARD_NAME); | 53 possible_types->insert(CREDIT_CARD_NAME); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 << UTF16ToUTF8(creditcard.GetFieldText(AutoFillType(CREDIT_CARD_TYPE))) | 510 << UTF16ToUTF8(creditcard.GetFieldText(AutoFillType(CREDIT_CARD_TYPE))) |
| 510 << " " | 511 << " " |
| 511 << UTF16ToUTF8(creditcard.GetFieldText(AutoFillType(CREDIT_CARD_NUMBER))) | 512 << UTF16ToUTF8(creditcard.GetFieldText(AutoFillType(CREDIT_CARD_NUMBER))) |
| 512 << " " | 513 << " " |
| 513 << UTF16ToUTF8(creditcard.GetFieldText( | 514 << UTF16ToUTF8(creditcard.GetFieldText( |
| 514 AutoFillType(CREDIT_CARD_EXP_MONTH))) | 515 AutoFillType(CREDIT_CARD_EXP_MONTH))) |
| 515 << " " | 516 << " " |
| 516 << UTF16ToUTF8(creditcard.GetFieldText( | 517 << UTF16ToUTF8(creditcard.GetFieldText( |
| 517 AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR))); | 518 AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR))); |
| 518 } | 519 } |
| OLD | NEW |