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

Unified Diff: chrome/browser/autofill/autofill_manager.cc

Issue 11415221: Add support for autofilling radio buttons and checkboxes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address comments Created 8 years 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/autofill/autofill_manager.cc
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index 89ce8f4fb6a026a71914655b1490de436798b652..8dc63d32a673e45cebae516f38b79ae07c580c47 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -654,6 +654,15 @@ void AutofillManager::OnFillAutofillFormData(int query_id,
// Mark the cached field as autofilled, so that we can detect when a user
// edits an autofilled field (for metrics).
form_structure->field(i)->is_autofilled = true;
+ } else if (cached_field->type() == FIELD_WITH_DEFAULT_VALUE &&
+ cached_field->is_checkable) {
+ string16 default_value = UTF8ToUTF16(cached_field->default_value());
+ // Mark the field checked if server says the default value of the field
+ // to be this field's value.
+ result.fields[i].is_checked = (default_value == result.fields[i].value);
+ // Mark the cached field as autofilled, so that we can detect when a user
+ // edits an autofilled field (for metrics).
+ form_structure->field(i)->is_autofilled = true;
}
}

Powered by Google App Engine
This is Rietveld 408576698