summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-23 19:47:41 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-23 19:47:41 +0000
commit6780b3bd5805018c242cde0a9cff3f48d12e4649 (patch)
tree4d208f861eb7d181010c5b230aad39ae96807bb7 /webkit
parent91451171aa98b6e44238517f39fc58a86028d75d (diff)
downloadchromium_src-6780b3bd5805018c242cde0a9cff3f48d12e4649.zip
chromium_src-6780b3bd5805018c242cde0a9cff3f48d12e4649.tar.gz
chromium_src-6780b3bd5805018c242cde0a9cff3f48d12e4649.tar.bz2
Add a label member to the FormField class. This member will hold the value of the field's label once we parse this value from the DOM.
BUG=none TEST=none Review URL: http://codereview.chromium.org/418032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/form_field.cc6
-rw-r--r--webkit/glue/form_field.h5
-rw-r--r--webkit/glue/form_field_values.cc4
3 files changed, 11 insertions, 4 deletions
diff --git a/webkit/glue/form_field.cc b/webkit/glue/form_field.cc
index 6d49054..a87644f 100644
--- a/webkit/glue/form_field.cc
+++ b/webkit/glue/form_field.cc
@@ -9,10 +9,12 @@ namespace webkit_glue {
FormField::FormField() {
}
-FormField::FormField(const string16& name,
+FormField::FormField(const string16& label,
+ const string16& name,
const string16& html_input_type,
const string16& value)
- : name_(name),
+ : label_(label),
+ name_(name),
html_input_type_(html_input_type),
value_(value) {
}
diff --git a/webkit/glue/form_field.h b/webkit/glue/form_field.h
index 92e8faea..9711c38 100644
--- a/webkit/glue/form_field.h
+++ b/webkit/glue/form_field.h
@@ -13,10 +13,12 @@ namespace webkit_glue {
class FormField {
public:
FormField();
- FormField(const string16& name,
+ FormField(const string16& label,
+ const string16& name,
const string16& html_input_type,
const string16& value);
+ string16 label() const { return label_; }
string16 name() const { return name_; }
string16 html_input_type() const { return html_input_type_; }
string16 value() const { return value_; }
@@ -24,6 +26,7 @@ class FormField {
void set_value(const string16& value) { value_ = value; }
private:
+ string16 label_;
string16 name_;
string16 html_input_type_;
string16 value_;
diff --git a/webkit/glue/form_field_values.cc b/webkit/glue/form_field_values.cc
index 66d6b0a..6118889 100644
--- a/webkit/glue/form_field_values.cc
+++ b/webkit/glue/form_field_values.cc
@@ -62,7 +62,9 @@ void FormFieldValues::ExtractFormFieldValues(
if (type.empty())
continue;
- elements.push_back(FormField(name, type, value));
+ // TODO(jhawkins): Extract the field label. For now we just use the field
+ // name.
+ elements.push_back(FormField(name, name, type, value));
}
}