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

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: Created 8 years, 1 month 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 aeeca26fbfef722c4a49830608ededf7de46c05d..a7218522ad0662eff7799dabc88b58c73f128d6a 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -648,6 +648,14 @@ 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 {
+ // Check if the field type is one with default value.
+ if (cached_field->type() == FIELD_WITH_DEFAULT_VALUE &&
+ cached_field->is_checkable) {
+ string16 default_value = ASCIIToUTF16(cached_field->default_value());
+ result.fields[i].is_checked = (default_value == result.fields[i].value);
+ form_structure->field(i)->is_autofilled = true;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698