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 4dd16a90df03a086b388050893dde8df916cc49d..5de7bd543afc45cae2d5fbeb2b19b4e0184f0d00 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
@@ -1164,8 +1164,10 @@ void AutofillDialogControllerImpl::ResetSectionInput(DialogSection section) { |
} |
DetailInputs* inputs = MutableRequestedFieldsForSection(section); |
- for (DetailInputs::iterator it = inputs->begin(); it != inputs->end(); ++it) { |
- it->initial_value = common::GetHardcodedValueForType(it->type); |
+ for (DetailInputs::iterator it = inputs->begin(); |
+ it != inputs->end(); ++it) { |
+ if (it->length != DetailInput::NONE) |
+ it->initial_value = common::GetHardcodedValueForType(it->type); |
} |
} |
@@ -1249,8 +1251,10 @@ void AutofillDialogControllerImpl::RestoreUserInputFromSnapshot( |
DetailInputs* inputs = MutableRequestedFieldsForSection(section); |
for (size_t i = 0; i < inputs->size(); ++i) { |
DetailInput* input = &(*inputs)[i]; |
- input->initial_value = |
- GetInfoFromInputs(snapshot, section, AutofillType(input->type)); |
+ if (input->length != DetailInput::NONE) { |
+ input->initial_value = |
+ GetInfoFromInputs(snapshot, section, AutofillType(input->type)); |
+ } |
if (InputWasEdited(input->type, input->initial_value)) |
SuggestionsMenuModelForSection(section)->SetCheckedItem(kAddNewItemKey); |
} |
@@ -3000,12 +3004,12 @@ void AutofillDialogControllerImpl::SuggestionsUpdated() { |
FieldValueMap::const_iterator billing_it = |
snapshot.find(ADDRESS_BILLING_COUNTRY); |
if (billing_it != snapshot.end()) |
- RebuildInputsForCountry(ActiveBillingSection(), billing_it->second, false); |
+ RebuildInputsForCountry(ActiveBillingSection(), billing_it->second, true); |
FieldValueMap::const_iterator shipping_it = |
snapshot.find(ADDRESS_HOME_COUNTRY); |
if (shipping_it != snapshot.end()) |
- RebuildInputsForCountry(SECTION_SHIPPING, shipping_it->second, false); |
+ RebuildInputsForCountry(SECTION_SHIPPING, shipping_it->second, true); |
RestoreUserInputFromSnapshot(snapshot); |
@@ -3174,7 +3178,7 @@ DialogSection AutofillDialogControllerImpl::SectionForSuggestionsMenuModel( |
CountryComboboxModel* AutofillDialogControllerImpl:: |
CountryComboboxModelForSection(DialogSection section) { |
- if (section == SECTION_BILLING || section == SECTION_CC_BILLING) |
+ if (section == SECTION_BILLING) |
return &billing_country_combobox_model_; |
if (section == SECTION_SHIPPING) |