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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 141843005: rAc: fix some validation issues (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index 4005cd637740de78e4b893536150352e6f725c0c..994fbbed790f85022c3f510b1aee56ed8e3de0bb 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -1745,7 +1745,6 @@ ValidityMessages AutofillDialogControllerImpl::InputsAreValid(
DialogSection section,
const FieldValueMap& inputs) {
ValidityMessages messages;
- FieldValueMap field_values;
for (FieldValueMap::const_iterator iter = inputs.begin();
iter != inputs.end(); ++iter) {
const ServerFieldType type = iter->first;
@@ -1757,23 +1756,11 @@ ValidityMessages AutofillDialogControllerImpl::InputsAreValid(
// it to be valid unless later proven otherwise.
bool sure = InputWasEdited(type, iter->second) ||
AutofillType(type).GetStorableType() == ADDRESS_HOME_COUNTRY;
-
- // Consider only individually valid fields for inter-field validation.
- if (text.empty()) {
- field_values[type] = iter->second;
- // If the field is valid but can be invalidated by inter-field validation,
Evan Stade 2014/01/31 00:22:13 example of the problem this caused: 1) CC is inva
groby-ooo-7-16 2014/01/31 19:59:59 I'm not sure this addresses that issue without sid
Evan Stade 2014/01/31 21:50:28 yes, we want it to always occur, so that we can va
- // assume it to be unsure.
- if (type == CREDIT_CARD_EXP_4_DIGIT_YEAR ||
- type == CREDIT_CARD_EXP_MONTH ||
- type == CREDIT_CARD_VERIFICATION_CODE ||
- type == PHONE_HOME_WHOLE_NUMBER ||
- type == PHONE_BILLING_WHOLE_NUMBER) {
- sure = false;
- }
- }
messages.Set(type, ValidityMessage(text, sure));
}
+ // For the convenience of using operator[].
+ FieldValueMap& field_values = const_cast<FieldValueMap&>(inputs);
// Validate the date formed by month and year field. (Autofill dialog is
// never supposed to have 2-digit years, so not checked).
if (field_values.count(CREDIT_CARD_EXP_4_DIGIT_YEAR) &&
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_types.h » ('j') | chrome/browser/ui/autofill/autofill_dialog_types.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698