summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/form_group.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/autofill/form_group.h')
-rw-r--r--chrome/browser/autofill/form_group.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/autofill/form_group.h b/chrome/browser/autofill/form_group.h
index b250773..e84cff2 100644
--- a/chrome/browser/autofill/form_group.h
+++ b/chrome/browser/autofill/form_group.h
@@ -11,6 +11,8 @@
#include "base/string_util.h"
#include "chrome/browser/autofill/field_types.h"
+struct FormFieldData;
+
// This class is an interface for collections of form fields, grouped by type.
// The information in objects of this class is managed by the
// PersonalDataManager.
@@ -47,6 +49,16 @@ class FormGroup {
virtual bool SetCanonicalizedInfo(AutofillFieldType type,
const string16& value);
+ // Fills in select control with data matching |type| from |this|.
+ // Public for testing purposes.
+ void FillSelectControl(AutofillFieldType type,
+ FormFieldData* field_data) const;
+
+ // Returns true if |value| is a valid US state name or abbreviation. It is
+ // case insensitive. Valid for US states only.
+ // TODO(estade): this is a crappy place for this function.
+ static bool IsValidState(const string16& value);
+
protected:
// AutofillProfile needs to call into GetSupportedTypes() for objects of
// non-AutofillProfile type, for which mere inheritance is insufficient.
@@ -55,6 +67,10 @@ class FormGroup {
// Returns a set of AutofillFieldTypes for which this FormGroup can store
// data. This method is additive on |supported_types|.
virtual void GetSupportedTypes(FieldTypeSet* supported_types) const = 0;
+
+ // Fills in a select control for a country from data in |this|. Returns true
+ // for success.
+ virtual bool FillCountrySelectControl(FormFieldData* field_data) const;
};
#endif // CHROME_BROWSER_AUTOFILL_FORM_GROUP_H_