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

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2611863002: Refactors cvc and expiration date validation in CC upload logic as well as unmask prompt. (Closed)
Patch Set: Initial Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 7cda51daaf99ff7885d5cd08847223df93587550..1d6224933da0ca33b1b3ada5d68866b8f4868326 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -1164,9 +1164,12 @@ void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
// local save but we believe that sometimes offering upload and sometimes
// offering local save is a confusing user experience.
int cvc;
+ size_t cvc_size =
+ upload_request_.card.type() == kAmericanExpressCard ? 4 : 3;
Mathieu 2017/01/04 16:37:22 Could you use (or extend) this code? https://cs.c
Moe 2017/01/04 18:07:31 Done.
for (const auto& field : submitted_form) {
if (field->Type().GetStorableType() == CREDIT_CARD_VERIFICATION_CODE &&
- base::StringToInt(field->value, &cvc)) {
+ base::StringToInt(field->value, &cvc) &&
+ field->value.size() == cvc_size) {
upload_request_.cvc = field->value;
break;
}
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698