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.h" | 5 #include "components/autofill/core/browser/credit_card.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <ostream> | 10 #include <ostream> |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 const base::string16 CreditCard::StripSeparators(const base::string16& number) { | 178 const base::string16 CreditCard::StripSeparators(const base::string16& number) { |
179 base::string16 stripped; | 179 base::string16 stripped; |
180 base::RemoveChars(number, base::ASCIIToUTF16("- "), &stripped); | 180 base::RemoveChars(number, base::ASCIIToUTF16("- "), &stripped); |
181 return stripped; | 181 return stripped; |
182 } | 182 } |
183 | 183 |
184 // static | 184 // static |
185 base::string16 CreditCard::TypeForDisplay(const std::string& type) { | 185 base::string16 CreditCard::TypeForDisplay(const std::string& type) { |
186 if (kGenericCard == type) | 186 if (kGenericCard == type) |
187 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_GENERIC); | 187 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_GENERIC); |
| 188 if (kAmericanExpressCard == type) |
| 189 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_AMEX_SHORT); |
| 190 |
188 return ::autofill::TypeForFill(type); | 191 return ::autofill::TypeForFill(type); |
189 } | 192 } |
190 | 193 |
191 // This method is not compiled on iOS because the resources are not used and | 194 // This method is not compiled on iOS because the resources are not used and |
192 // should not be shipped. | 195 // should not be shipped. |
193 #if !defined(OS_IOS) | 196 #if !defined(OS_IOS) |
194 // static | 197 // static |
195 int CreditCard::IconResourceId(const std::string& type) { | 198 int CreditCard::IconResourceId(const std::string& type) { |
196 if (type == kAmericanExpressCard) | 199 if (type == kAmericanExpressCard) |
197 return IDR_AUTOFILL_CC_AMEX; | 200 return IDR_AUTOFILL_CC_AMEX; |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 const char* const kAmericanExpressCard = "americanExpressCC"; | 776 const char* const kAmericanExpressCard = "americanExpressCC"; |
774 const char* const kDinersCard = "dinersCC"; | 777 const char* const kDinersCard = "dinersCC"; |
775 const char* const kDiscoverCard = "discoverCC"; | 778 const char* const kDiscoverCard = "discoverCC"; |
776 const char* const kGenericCard = "genericCC"; | 779 const char* const kGenericCard = "genericCC"; |
777 const char* const kJCBCard = "jcbCC"; | 780 const char* const kJCBCard = "jcbCC"; |
778 const char* const kMasterCard = "masterCardCC"; | 781 const char* const kMasterCard = "masterCardCC"; |
779 const char* const kUnionPay = "unionPayCC"; | 782 const char* const kUnionPay = "unionPayCC"; |
780 const char* const kVisaCard = "visaCC"; | 783 const char* const kVisaCard = "visaCC"; |
781 | 784 |
782 } // namespace autofill | 785 } // namespace autofill |
OLD | NEW |