diff options
Diffstat (limited to 'webkit/glue/form_field.cc')
-rw-r--r-- | webkit/glue/form_field.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/webkit/glue/form_field.cc b/webkit/glue/form_field.cc index 30d22ad..bcc9926 100644 --- a/webkit/glue/form_field.cc +++ b/webkit/glue/form_field.cc @@ -20,13 +20,15 @@ using WebKit::WebVector; namespace webkit_glue { FormField::FormField() - : size_(0) { + : max_length_(0), + is_autofilled_(false) { } // TODO(jhawkins): This constructor should probably be deprecated and the // functionality moved to FormManager. FormField::FormField(WebFormControlElement element) - : size_(0) { + : max_length_(0), + is_autofilled_(false) { name_ = element.nameForAutofill(); // TODO(jhawkins): Extract the field label. For now we just use the field @@ -37,7 +39,8 @@ FormField::FormField(WebFormControlElement element) if (form_control_type_ == ASCIIToUTF16("text")) { const WebInputElement& input_element = element.toConst<WebInputElement>(); value_ = input_element.value(); - size_ = input_element.size(); + max_length_ = input_element.size(); + is_autofilled_ = input_element.isAutofilled(); } else if (form_control_type_ == ASCIIToUTF16("select-one")) { WebSelectElement select_element = element.to<WebSelectElement>(); value_ = select_element.value(); @@ -58,12 +61,14 @@ FormField::FormField(const string16& label, const string16& name, const string16& value, const string16& form_control_type, - int size) + int max_length, + bool is_autofilled) : label_(label), name_(name), value_(value), form_control_type_(form_control_type), - size_(size) { + max_length_(max_length), + is_autofilled_(is_autofilled) { } FormField::~FormField() { @@ -75,7 +80,7 @@ bool FormField::operator==(const FormField& field) const { return (label_ == field.label_ && name_ == field.name_ && form_control_type_ == field.form_control_type_ && - size_ == field.size_); + max_length_ == field.max_length_); } bool FormField::operator!=(const FormField& field) const { @@ -87,7 +92,7 @@ bool FormField::StrictlyEqualsHack(const FormField& field) const { name_ == field.name_ && value_ == field.value_ && form_control_type_ == field.form_control_type_ && - size_ == field.size_); + max_length_ == field.max_length_); } std::ostream& operator<<(std::ostream& os, const FormField& field) { @@ -100,7 +105,7 @@ std::ostream& operator<<(std::ostream& os, const FormField& field) { << " " << UTF16ToUTF8(field.form_control_type()) << " " - << field.size(); + << field.max_length(); } } // namespace webkit_glue |