Chromium Code Reviews| Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
| diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
| index 8da87595200e51981cf2143645da31ab92b92040..5ceb00fbdb8534ab202a6c6abf28e058ef029290 100644 |
| --- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
| +++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc |
| @@ -2256,7 +2256,7 @@ void AutofillDialogViews::TextfieldEditedOrActivated( |
| SetValidityForInput<DecoratedTextfield>( |
| decorated, |
| delegate_->InputValidityMessage(group->section, type, |
| - textfield->text())); |
| + textfield->text())); |
| // If the field transitioned from invalid to valid, re-validate the group, |
| // since inter-field checks become meaningful with valid fields. |
| @@ -2264,8 +2264,18 @@ void AutofillDialogViews::TextfieldEditedOrActivated( |
| ValidateGroup(*group, VALIDATE_EDIT); |
| } |
| - gfx::Image icon = delegate_->IconForField(type, textfield->text()); |
| - decorated->SetIcon(icon); |
| + if (!delegate_->IsIconDependentField(type)) |
| + decorated->SetIcon(delegate_->IconForField(type, textfield->text())); |
| + |
| + ServerFieldType dependent_type = UNKNOWN_TYPE; |
| + if (delegate_->IsIconDependencyField(type, &dependent_type)) { |
| + DecoratedTextfield* dependent_field = |
| + DecoratedTextfieldForServerFieldType(group, dependent_type); |
| + if (dependent_field) { |
| + dependent_field->SetIcon( |
| + delegate_->IconForField(dependent_type, textfield->text())); |
|
Evan Stade
2013/09/11 00:17:03
API abuse! you're passing a type and a textval tha
please use gerrit instead
2013/09/11 16:27:40
How about adding an API call "IconForDependentFiel
|
| + } |
| + } |
| } |
| void AutofillDialogViews::UpdateButtonStripExtraView() { |
| @@ -2353,6 +2363,19 @@ void AutofillDialogViews::DetailsContainerBoundsChanged() { |
| error_bubble_->UpdatePosition(); |
| } |
| +DecoratedTextfield* AutofillDialogViews::DecoratedTextfieldForServerFieldType( |
| + const DetailsGroup* group, |
| + ServerFieldType type) const { |
| + for (TextfieldMap::const_iterator field_iter = group->textfields.begin(); |
| + field_iter != group->textfields.end(); |
| + ++field_iter) { |
| + if (field_iter->first->type == type) |
| + return field_iter->second; |
| + } |
| + |
| + return NULL; |
| +} |
| + |
| AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) |
| : section(section), |
| container(NULL), |