| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 NOTREACHED(); | 330 NOTREACHED(); |
| 331 break; | 331 break; |
| 332 | 332 |
| 333 default: | 333 default: |
| 334 DLOG(ERROR) << "Attempting to set unknown info-type " | 334 DLOG(ERROR) << "Attempting to set unknown info-type " |
| 335 << type.field_type(); | 335 << type.field_type(); |
| 336 break; | 336 break; |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 | 339 |
| 340 const string16 CreditCard::Label() const { |
| 341 return label_; |
| 342 } |
| 343 |
| 340 string16 CreditCard::ObfuscatedNumber() const { | 344 string16 CreditCard::ObfuscatedNumber() const { |
| 341 if (number().empty()) | 345 if (number().empty()) |
| 342 return string16(); // No CC number, means empty preview. | 346 return string16(); // No CC number, means empty preview. |
| 343 string16 result(ASCIIToUTF16(kCreditCardObfuscationString)); | 347 string16 result(ASCIIToUTF16(kCreditCardObfuscationString)); |
| 344 result.append(last_four_digits()); | 348 result.append(last_four_digits()); |
| 345 | 349 |
| 346 return result; | 350 return result; |
| 347 } | 351 } |
| 348 | 352 |
| 349 string16 CreditCard::PreviewSummary() const { | 353 string16 CreditCard::PreviewSummary() const { |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 << UTF16ToUTF8(credit_card.GetFieldText(AutoFillType(CREDIT_CARD_TYPE))) | 636 << UTF16ToUTF8(credit_card.GetFieldText(AutoFillType(CREDIT_CARD_TYPE))) |
| 633 << " " | 637 << " " |
| 634 << UTF16ToUTF8(credit_card.GetFieldText(AutoFillType(CREDIT_CARD_NUMBER))) | 638 << UTF16ToUTF8(credit_card.GetFieldText(AutoFillType(CREDIT_CARD_NUMBER))) |
| 635 << " " | 639 << " " |
| 636 << UTF16ToUTF8(credit_card.GetFieldText( | 640 << UTF16ToUTF8(credit_card.GetFieldText( |
| 637 AutoFillType(CREDIT_CARD_EXP_MONTH))) | 641 AutoFillType(CREDIT_CARD_EXP_MONTH))) |
| 638 << " " | 642 << " " |
| 639 << UTF16ToUTF8(credit_card.GetFieldText( | 643 << UTF16ToUTF8(credit_card.GetFieldText( |
| 640 AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR))); | 644 AutoFillType(CREDIT_CARD_EXP_4_DIGIT_YEAR))); |
| 641 } | 645 } |
| OLD | NEW |