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 && |
Ilya Sherman
2012/12/01 00:54:12
nit: Combine this with the else on line 651, as in
Raman Kakilate
2012/12/06 01:54:05
Done.
|
+ cached_field->is_checkable) { |
+ string16 default_value = ASCIIToUTF16(cached_field->default_value()); |
Ilya Sherman
2012/12/01 00:54:12
How do you know that the cached_field's default va
Raman Kakilate
2012/12/06 01:54:05
Changed it to UTF8ToUTF16. I am not entirely sure
Ilya Sherman
2012/12/07 01:47:22
I'm not certain, but it's likely. Vadim Berman wo
Raman Kakilate
2012/12/10 18:36:45
Vadim was also not sure. Code says its UTF8.
In
|
+ result.fields[i].is_checked = (default_value == result.fields[i].value); |
Ilya Sherman
2012/12/01 00:54:12
I'm confused by this line. Why isn't it just "res
Raman Kakilate
2012/12/06 01:54:05
as I understand, for checkboxes and radio buttons
Ilya Sherman
2012/12/07 01:47:22
If the user can't set the value, why doesn't the s
Raman Kakilate
2012/12/10 18:36:45
For a form with radio buttons, eg.
<form>
<input
Ilya Sherman
2012/12/11 05:56:19
Perhaps this is a reason to include the value in t
Raman Kakilate
2012/12/11 17:45:45
In this CL, I am counting radio-buttons/checkboxes
|
+ form_structure->field(i)->is_autofilled = true; |
Ilya Sherman
2012/12/01 00:54:12
nit: Please reproduce the comment from line 648-64
Raman Kakilate
2012/12/06 01:54:05
Done.
|
+ } |
} |
} |