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 f4679ab0fcc76c4fd0f6734d275125ccae5baa3d..eec44189cc1179dbec0dd3d3b1de295c72dfca1f 100644 |
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
@@ -761,8 +761,9 @@ void AutofillDialogControllerImpl::PrepareDetailInputsForSection( |
DialogSection section) { |
// Reset all previously entered data and stop editing |section|. |
DetailInputs* inputs = MutableRequestedFieldsForSection(section); |
- for (size_t i = 0; i < inputs->size(); ++i) { |
- (*inputs)[i].initial_value.clear(); |
+ for (DetailInputs::iterator it = inputs->begin(); it != inputs->end(); ++it) { |
+ it->initial_value.clear(); |
+ it->enabled = InputIsEnabled(*it, section); |
} |
section_editing_state_[section] = false; |
@@ -2261,6 +2262,13 @@ bool AutofillDialogControllerImpl::IsManuallyEditingAnySection() const { |
return false; |
} |
+bool AutofillDialogControllerImpl::InputIsEnabled(const DetailInput& input, |
+ DialogSection section) const { |
+ return !(IsPayingWithWallet() && |
+ input.type == CREDIT_CARD_NUMBER && |
+ section_editing_state_[SECTION_CC_BILLING]); |
+} |
+ |
bool AutofillDialogControllerImpl::InputIsValid(AutofillFieldType type, |
const string16& value) const { |
switch (AutofillType::GetEquivalentFieldType(type)) { |