Chromium Code Reviews| 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/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1068 // this block can be reached on observing either a new card or one already | 1068 // this block can be reached on observing either a new card or one already |
| 1069 // stored locally. We will offer to upload either kind. | 1069 // stored locally. We will offer to upload either kind. |
| 1070 upload_request_ = payments::PaymentsClient::UploadRequestDetails(); | 1070 upload_request_ = payments::PaymentsClient::UploadRequestDetails(); |
| 1071 upload_request_.card = *imported_credit_card; | 1071 upload_request_.card = *imported_credit_card; |
| 1072 | 1072 |
| 1073 // Check for a CVC to determine whether we can prompt the user to upload | 1073 // Check for a CVC to determine whether we can prompt the user to upload |
| 1074 // their card. If no CVC is present, do nothing. We could fall back to a | 1074 // their card. If no CVC is present, do nothing. We could fall back to a |
| 1075 // local save but we believe that sometimes offering upload and sometimes | 1075 // local save but we believe that sometimes offering upload and sometimes |
| 1076 // offering local save is a confusing user experience. | 1076 // offering local save is a confusing user experience. |
| 1077 for (const AutofillField* field : submitted_form) { | 1077 for (const AutofillField* field : submitted_form) { |
| 1078 if (field->Type().GetStorableType() == CREDIT_CARD_VERIFICATION_CODE) { | 1078 if (field->Type().GetStorableType() == CREDIT_CARD_VERIFICATION_CODE && |
| 1079 !field->value.empty()) { | |
|
Mathieu
2016/04/20 20:00:41
note that this is still not fully robust (some fie
Justin Donnelly
2016/04/20 20:58:01
Good idea. Done.
| |
| 1079 upload_request_.cvc = field->value; | 1080 upload_request_.cvc = field->value; |
| 1080 break; | 1081 break; |
| 1081 } | 1082 } |
| 1082 } | 1083 } |
| 1083 if (upload_request_.cvc.empty()) { | 1084 if (upload_request_.cvc.empty()) { |
| 1084 AutofillMetrics::LogCardUploadDecisionMetric( | 1085 AutofillMetrics::LogCardUploadDecisionMetric( |
| 1085 AutofillMetrics::UPLOAD_NOT_OFFERED_NO_CVC); | 1086 AutofillMetrics::UPLOAD_NOT_OFFERED_NO_CVC); |
| 1086 return; | 1087 return; |
| 1087 } | 1088 } |
| 1088 | 1089 |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2017 if (i > 0) | 2018 if (i > 0) |
| 2018 fputs("Next oldest form:\n", file); | 2019 fputs("Next oldest form:\n", file); |
| 2019 } | 2020 } |
| 2020 fputs("\n", file); | 2021 fputs("\n", file); |
| 2021 | 2022 |
| 2022 fclose(file); | 2023 fclose(file); |
| 2023 } | 2024 } |
| 2024 #endif // ENABLE_FORM_DEBUG_DUMP | 2025 #endif // ENABLE_FORM_DEBUG_DUMP |
| 2025 | 2026 |
| 2026 } // namespace autofill | 2027 } // namespace autofill |
| OLD | NEW |