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

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

Issue 1903183003: Look in all available CVC fields for a value for credit card upload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use StringToInt instead of !empty Created 4 years, 8 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 ea4c155b95a449c7ed10a19e9755d9580b4c07d5..4e9e91badd688f8e78b2a7d99dc3f353549c4b04 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -24,6 +24,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/strings/string16.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -1074,8 +1075,10 @@ void AutofillManager::ImportFormData(const FormStructure& submitted_form) {
// their card. If no CVC is present, do nothing. We could fall back to a
// local save but we believe that sometimes offering upload and sometimes
// offering local save is a confusing user experience.
+ int cvc;
for (const AutofillField* field : submitted_form) {
- if (field->Type().GetStorableType() == CREDIT_CARD_VERIFICATION_CODE) {
+ if (field->Type().GetStorableType() == CREDIT_CARD_VERIFICATION_CODE &&
+ base::StringToInt(field->value, &cvc)) {
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