| 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/validation.h" | 5 #include "components/autofill/core/browser/validation.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 !autofill::PersonalDataManager::GetProfileFromProfilesByGUID( | 147 !autofill::PersonalDataManager::GetProfileFromProfilesByGUID( |
| 148 card.billing_address_id(), billing_addresses)) { | 148 card.billing_address_id(), billing_addresses)) { |
| 149 status |= CREDIT_CARD_NO_BILLING_ADDRESS; | 149 status |= CREDIT_CARD_NO_BILLING_ADDRESS; |
| 150 } | 150 } |
| 151 | 151 |
| 152 return status; | 152 return status; |
| 153 } | 153 } |
| 154 | 154 |
| 155 base::string16 GetCompletionMessageForCard(CreditCardCompletionStatus status) { | 155 base::string16 GetCompletionMessageForCard(CreditCardCompletionStatus status) { |
| 156 switch (status) { | 156 switch (status) { |
| 157 // No message is shown for complete or expired card (which will be fixable) |
| 158 // in the CVC screen. |
| 157 case CREDIT_CARD_COMPLETE: | 159 case CREDIT_CARD_COMPLETE: |
| 160 case CREDIT_CARD_EXPIRED: |
| 158 return base::string16(); | 161 return base::string16(); |
| 159 case CREDIT_CARD_EXPIRED: | |
| 160 return l10n_util::GetStringUTF16( | |
| 161 IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED); | |
| 162 case CREDIT_CARD_NO_CARDHOLDER: | 162 case CREDIT_CARD_NO_CARDHOLDER: |
| 163 return l10n_util::GetStringUTF16(IDS_PAYMENTS_NAME_ON_CARD_REQUIRED); | 163 return l10n_util::GetStringUTF16(IDS_PAYMENTS_NAME_ON_CARD_REQUIRED); |
| 164 case CREDIT_CARD_NO_NUMBER: | 164 case CREDIT_CARD_NO_NUMBER: |
| 165 return l10n_util::GetStringUTF16( | 165 return l10n_util::GetStringUTF16( |
| 166 IDS_PAYMENTS_CARD_NUMBER_INVALID_VALIDATION_MESSAGE); | 166 IDS_PAYMENTS_CARD_NUMBER_INVALID_VALIDATION_MESSAGE); |
| 167 case CREDIT_CARD_NO_BILLING_ADDRESS: | 167 case CREDIT_CARD_NO_BILLING_ADDRESS: |
| 168 return l10n_util::GetStringUTF16( | 168 return l10n_util::GetStringUTF16( |
| 169 IDS_PAYMENTS_CARD_BILLING_ADDRESS_REQUIRED); | 169 IDS_PAYMENTS_CARD_BILLING_ADDRESS_REQUIRED); |
| 170 default: | 170 default: |
| 171 // Multiple things are missing | 171 // Multiple things are missing |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 return AMEX_CVC_LENGTH; | 376 return AMEX_CVC_LENGTH; |
| 377 | 377 |
| 378 return GENERAL_CVC_LENGTH; | 378 return GENERAL_CVC_LENGTH; |
| 379 } | 379 } |
| 380 | 380 |
| 381 bool IsUPIVirtualPaymentAddress(const base::string16& value) { | 381 bool IsUPIVirtualPaymentAddress(const base::string16& value) { |
| 382 return MatchesPattern(value, base::ASCIIToUTF16(kUPIVirtualPaymentAddressRe)); | 382 return MatchesPattern(value, base::ASCIIToUTF16(kUPIVirtualPaymentAddressRe)); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace autofill | 385 } // namespace autofill |
| OLD | NEW |