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