Skip to content

Commit

Permalink
[rAC, OSX] Validate only enabled fields.
Browse files Browse the repository at this point in the history
Un-editable fields are field by the controller with values that do not
need to be validated - skip them during validation runs.

BUG=277321
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/25830002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227189 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
groby@chromium.org committed Oct 5, 2013
1 parent 2e19c16 commit 456f136
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,16 @@ - (BOOL)validateFor:(autofill::ValidationType)validationType {
if (![inputs_ isHidden]) {
fields = [inputs_ subviews];
} else if (section_ == autofill::SECTION_CC) {
fields = @[[suggestContainer_ inputField]];
fields = @[ [suggestContainer_ inputField] ];
}

// Ensure only editable fields are validated.
fields = [fields filteredArrayUsingPredicate:
[NSPredicate predicateWithBlock:
^BOOL(NSControl<AutofillInputField>* field, NSDictionary* bindings) {
return [field isEnabled];
}]];

autofill::DetailOutputMap detailOutputs;
[self fillDetailOutputs:&detailOutputs fromControls:fields];
autofill::ValidityMessages messages = delegate_->InputsAreValid(
Expand Down

0 comments on commit 456f136

Please sign in to comment.