Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: components/autofill/core/browser/validation.cc

Issue 2711543003: [Payments] Unify the card number invalid string (Closed)
Patch Set: Initial Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_piece.h" 10 #include "base/strings/string_piece.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 *error_message = l10n_util::GetStringUTF16( 264 *error_message = l10n_util::GetStringUTF16(
265 IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED); 265 IDS_PAYMENTS_VALIDATION_INVALID_CREDIT_CARD_EXPIRED);
266 } 266 }
267 break; 267 break;
268 } 268 }
269 269
270 case CREDIT_CARD_NUMBER: 270 case CREDIT_CARD_NUMBER:
271 if (IsValidCreditCardNumber(value)) 271 if (IsValidCreditCardNumber(value))
272 return true; 272 return true;
273 273
274 if (error_message) 274 if (error_message) {
275 *error_message = 275 *error_message = l10n_util::GetStringUTF16(
276 l10n_util::GetStringUTF16(IDS_PAYMENTS_CARD_NUMBER_INVALID); 276 IDS_PAYMENTS_CARD_NUMBER_INVALID_VALIDATION_MESSAGE);
277 }
277 break; 278 break;
278 279
279 default: 280 default:
280 // Other types such as CREDIT_CARD_TYPE and CREDIT_CARD_VERIFICATION_CODE 281 // Other types such as CREDIT_CARD_TYPE and CREDIT_CARD_VERIFICATION_CODE
281 // are not validated for now. 282 // are not validated for now.
282 NOTREACHED() << "Attempting to validate unsupported type " << type; 283 NOTREACHED() << "Attempting to validate unsupported type " << type;
283 break; 284 break;
284 } 285 }
285 return false; 286 return false;
286 } 287 }
287 288
288 } // namespace autofill 289 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698