Chromium Code Reviews| Index: components/autofill/core/browser/form_structure.cc |
| diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc |
| index aa42b4f434fc4996cd1e3ca4164f3cc7de41e5a2..eb4590dcfbcdf6fee86ae1e0a8ebe867d34d7660 100644 |
| --- a/components/autofill/core/browser/form_structure.cc |
| +++ b/components/autofill/core/browser/form_structure.cc |
| @@ -1171,6 +1171,28 @@ bool FormStructure::FillFields( |
| return filled_something; |
| } |
| +std::set<base::string16> FormStructure::PossibleValues(ServerFieldType type) { |
| + std::set<base::string16> values; |
| + AutofillType target_type(type); |
| + for (std::vector<AutofillField*>::iterator iter = fields_.begin(); |
| + iter != fields_.end(); ++iter) { |
| + AutofillField* field = *iter; |
| + if (field->Type().GetStorableType() != target_type.GetStorableType() || |
| + field->Type().group() != target_type.group()) { |
|
Ilya Sherman
2014/03/03 23:55:54
Optional nit: Maybe it makes sense to add an IsEqu
Evan Stade
2014/03/04 00:11:30
Using IsEquivalentTo would just force the next dev
|
| + continue; |
| + } |
| + |
| + // No option values; anything goes. |
| + if (field->option_values.empty()) |
| + return std::set<base::string16>(); |
| + |
| + values.insert(field->option_values.begin(), field->option_values.end()); |
| + values.insert(field->option_contents.begin(), field->option_contents.end()); |
| + } |
| + |
| + return values; |
| +} |
| + |
| void FormStructure::IdentifySections(bool has_author_specified_sections) { |
| if (fields_.empty()) |
| return; |