| 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_field.h" | 5 #include "components/autofill/core/browser/credit_card_field.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "components/autofill/core/browser/autofill_field.h" | 18 #include "components/autofill/core/browser/autofill_field.h" |
| 19 #include "components/autofill/core/browser/autofill_regex_constants.h" | |
| 20 #include "components/autofill/core/browser/autofill_scanner.h" | 19 #include "components/autofill/core/browser/autofill_scanner.h" |
| 21 #include "components/autofill/core/browser/field_types.h" | 20 #include "components/autofill/core/browser/field_types.h" |
| 22 #include "components/autofill/core/common/autofill_clock.h" | 21 #include "components/autofill/core/common/autofill_clock.h" |
| 22 #include "components/autofill/core/common/autofill_regex_constants.h" |
| 23 #include "components/autofill/core/common/autofill_regexes.h" | 23 #include "components/autofill/core/common/autofill_regexes.h" |
| 24 #include "components/strings/grit/components_strings.h" | 24 #include "components/strings/grit/components_strings.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 26 | 26 |
| 27 namespace autofill { | 27 namespace autofill { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Credit card numbers are at most 19 digits in length. | 31 // Credit card numbers are at most 19 digits in length. |
| 32 // [Ref: http://en.wikipedia.org/wiki/Bank_card_number] | 32 // [Ref: http://en.wikipedia.org/wiki/Bank_card_number] |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 : ((expiration_year_ && expiration_year_->max_length == 2) | 507 : ((expiration_year_ && expiration_year_->max_length == 2) |
| 508 ? CREDIT_CARD_EXP_2_DIGIT_YEAR | 508 ? CREDIT_CARD_EXP_2_DIGIT_YEAR |
| 509 : CREDIT_CARD_EXP_4_DIGIT_YEAR)); | 509 : CREDIT_CARD_EXP_4_DIGIT_YEAR)); |
| 510 } | 510 } |
| 511 | 511 |
| 512 bool CreditCardField::HasExpiration() const { | 512 bool CreditCardField::HasExpiration() const { |
| 513 return expiration_date_ || (expiration_month_ && expiration_year_); | 513 return expiration_date_ || (expiration_month_ && expiration_year_); |
| 514 } | 514 } |
| 515 | 515 |
| 516 } // namespace autofill | 516 } // namespace autofill |
| OLD | NEW |