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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.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
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_types.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 488de98252d098905991cd6a8320c73f468b5ce5..2944948d36920770d1b097e3b2d1002e7e6072e9 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -1506,6 +1506,7 @@ void AutofillDialogViews::UpdateSectionImpl(
if (text_mapping != group->textfields.end()) {
views::Textfield* textfield = text_mapping->second->textfield();
+ textfield->SetEnabled(input.editable);
if (textfield->text().empty() || clobber_inputs) {
textfield->SetText(iter->initial_value);
textfield->SetIcon(controller_->IconForField(
@@ -1516,6 +1517,7 @@ void AutofillDialogViews::UpdateSectionImpl(
ComboboxMap::iterator combo_mapping = group->comboboxes.find(&input);
if (combo_mapping != group->comboboxes.end()) {
views::Combobox* combobox = combo_mapping->second;
+ combobox->SetEnabled(input.editable);
if (combobox->selected_index() == combobox->model()->GetDefaultIndex() ||
clobber_inputs) {
for (int i = 0; i < combobox->model()->GetItemCount(); ++i) {
@@ -1619,6 +1621,9 @@ bool AutofillDialogViews::ValidateGroup(
if (group.manual_input->visible()) {
for (TextfieldMap::const_iterator iter = group.textfields.begin();
iter != group.textfields.end(); ++iter) {
+ if (!iter->first->editable)
+ continue;
+
detail_outputs[iter->first] = iter->second->textfield()->text();
field_map[iter->first->type] = base::Bind(
&AutofillDialogViews::SetValidityForInput<DecoratedTextfield>,
@@ -1627,6 +1632,9 @@ bool AutofillDialogViews::ValidateGroup(
}
for (ComboboxMap::const_iterator iter = group.comboboxes.begin();
iter != group.comboboxes.end(); ++iter) {
+ if (!iter->first->editable)
+ continue;
+
views::Combobox* combobox = iter->second;
string16 item =
combobox->model()->GetItemAt(combobox->selected_index());
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_types.h ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698