| 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 f86439de6e5f944b51dae4da3170ea821696c723..368594580ab9f392856c25ae4dd873b295a62553 100644
|
| --- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
|
| +++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
|
| @@ -632,7 +632,8 @@ void AutofillDialogViews::UpdateNotificationArea() {
|
| ContentsPreferredSizeChanged();
|
| }
|
|
|
| -void AutofillDialogViews::UpdateSection(DialogSection section) {
|
| +void AutofillDialogViews::UpdateSection(DialogSection section,
|
| + bool clear_user_input) {
|
| const DetailInputs& updated_inputs =
|
| controller_->RequestedFieldsForSection(section);
|
| DetailsGroup* group = GroupForSection(section);
|
| @@ -641,8 +642,14 @@ void AutofillDialogViews::UpdateSection(DialogSection section) {
|
| iter != updated_inputs.end(); ++iter) {
|
| const DetailInput& input = *iter;
|
| TextfieldMap::iterator text_mapping = group->textfields.find(&input);
|
| - if (text_mapping != group->textfields.end())
|
| +
|
| + // If there is already text in the input and |clear_user_input| is false,
|
| + // then leave the input alone.
|
| + if (text_mapping != group->textfields.end() &&
|
| + (text_mapping->second->textfield()->text().empty() ||
|
| + clear_user_input)) {
|
| text_mapping->second->textfield()->SetText(iter->initial_value);
|
| + }
|
|
|
| ComboboxMap::iterator combo_mapping = group->comboboxes.find(&input);
|
| if (combo_mapping != group->comboboxes.end()) {
|
|
|