Chromium Code Reviews| Index: components/autofill/core/browser/form_structure.h |
| diff --git a/components/autofill/core/browser/form_structure.h b/components/autofill/core/browser/form_structure.h |
| index 578c4131f12f0b5c071db009b0456ebfb2c92b9d..b49ca1c38d61326c92a1276d02c294b4ef120277 100644 |
| --- a/components/autofill/core/browser/form_structure.h |
| +++ b/components/autofill/core/browser/form_structure.h |
| @@ -5,6 +5,7 @@ |
| #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| #define COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_STRUCTURE_H_ |
| +#include <set> |
| #include <string> |
| #include <vector> |
| @@ -151,6 +152,14 @@ class FormStructure { |
| const base::Callback<base::string16(const AutofillType&)>& get_info, |
| const std::string& app_locale); |
| + // Returns the values that can be filled into the form structure for the |
| + // given type. For example, there's no way to fill in a value of "The Moon" |
| + // into ADDRESS_HOME_STATE if the form only has a |
| + // <select autocomplete="region"> with no "The Moon" option. Returns an |
| + // empty set if the form doesn't reference the given type or if all inputs |
| + // are accepted (e.g., <input type="text" autocomplete="region">). |
| + std::set<base::string16> PossibleValues(ServerFieldType type); |
|
Ilya Sherman
2014/03/03 23:55:54
'ServerFieldType' is a strange choice of type to p
Ilya Sherman
2014/03/03 23:55:54
nit: This method name is rather vague. Perhaps "G
Ilya Sherman
2014/03/03 23:55:54
You are expanding the public API of this class, so
Evan Stade
2014/03/04 00:11:30
I started with that, but it makes the call sites m
Evan Stade
2014/03/04 00:11:30
Do you think it's vague when you see it in the con
Evan Stade
2014/03/04 00:11:30
See my other comment on why I think that is a bad
Ilya Sherman
2014/03/04 00:53:57
Yes, I do. The call site just forwards a bunch of
Ilya Sherman
2014/03/04 00:53:57
This code lives in a different component from the
|
| + |
| const AutofillField* field(size_t index) const; |
| AutofillField* field(size_t index); |
| size_t field_count() const; |