Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 15979002: Making credit card number un-editable in Wallet mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)) {

Powered by Google App Engine
This is Rietveld 408576698