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

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: merge 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
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/autofill_dialog_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e9a40956f5ce54b5f1bea9dc5556bd7ab6dc2ea6..9744d895ac9a133714864740d37858f339ef3061 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -1803,8 +1803,6 @@ ValidityMessages AutofillDialogControllerImpl::InputsAreValid(
if (inputs.empty())
return messages;
- FieldValueMap field_values;
-
if (i18ninput::Enabled() && section != SECTION_CC) {
AddressData address_data;
i18ninput::CreateAddressData(
@@ -1833,9 +1831,6 @@ ValidityMessages AutofillDialogControllerImpl::InputsAreValid(
for (FieldValueMap::const_iterator iter = inputs.begin();
iter != inputs.end(); ++iter) {
const ServerFieldType type = iter->first;
- if (!messages.GetMessageOrDefault(type).text.empty())
- continue;
-
base::string16 text = InputValidityMessage(section, type, iter->second);
// Skip empty/unchanged fields in edit mode. Ignore country as it always has
@@ -1843,23 +1838,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,
- // 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698