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 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // The last site is currently unavailable, but a cached version remains at | 177 // The last site is currently unavailable, but a cached version remains at |
178 // http://web.archive.org/web/20120923111349/http://www.beachnet.com/~hstiles/
cardtype.html | 178 // http://web.archive.org/web/20120923111349/http://www.beachnet.com/~hstiles/
cardtype.html |
179 // | 179 // |
180 // Card Type Prefix(es) Length | 180 // Card Type Prefix(es) Length |
181 // --------------------------------------------------------------- | 181 // --------------------------------------------------------------- |
182 // Visa 4 13,16 | 182 // Visa 4 13,16 |
183 // American Express 34,37 15 | 183 // American Express 34,37 15 |
184 // Diners Club 300-305,3095,36,38-39 14 | 184 // Diners Club 300-305,3095,36,38-39 14 |
185 // Discover Card 6011,644-649,65 16 | 185 // Discover Card 6011,644-649,65 16 |
186 // JCB 3528-3589 16 | 186 // JCB 3528-3589 16 |
187 // MasterCard 51-55 16 | 187 // Mastercard 51-55 16 |
188 // UnionPay 62 16-19 | 188 // UnionPay 62 16-19 |
189 | 189 |
190 // Check for prefixes of length 1. | 190 // Check for prefixes of length 1. |
191 if (number.empty()) | 191 if (number.empty()) |
192 return kGenericCard; | 192 return kGenericCard; |
193 | 193 |
194 if (number[0] == '4') | 194 if (number[0] == '4') |
195 return kVisaCard; | 195 return kVisaCard; |
196 | 196 |
197 // Check for prefixes of length 2. | 197 // Check for prefixes of length 2. |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
929 const char kDinersCard[] = "dinersCC"; | 929 const char kDinersCard[] = "dinersCC"; |
930 const char kDiscoverCard[] = "discoverCC"; | 930 const char kDiscoverCard[] = "discoverCC"; |
931 const char kGenericCard[] = "genericCC"; | 931 const char kGenericCard[] = "genericCC"; |
932 const char kJCBCard[] = "jcbCC"; | 932 const char kJCBCard[] = "jcbCC"; |
933 const char kMasterCard[] = "masterCardCC"; | 933 const char kMasterCard[] = "masterCardCC"; |
934 const char kMirCard[] = "mirCC"; | 934 const char kMirCard[] = "mirCC"; |
935 const char kUnionPay[] = "unionPayCC"; | 935 const char kUnionPay[] = "unionPayCC"; |
936 const char kVisaCard[] = "visaCC"; | 936 const char kVisaCard[] = "visaCC"; |
937 | 937 |
938 } // namespace autofill | 938 } // namespace autofill |
OLD | NEW |