summaryrefslogtreecommitdiffstats
path: root/webkit/glue/form_field.cc
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-06-28 21:49:31 +0100
committerKristian Monsen <kristianm@google.com>2011-07-08 17:55:00 +0100
commitddb351dbec246cf1fab5ec20d2d5520909041de1 (patch)
tree158e3fb57bdcac07c7f1e767fde3c70687c9fbb1 /webkit/glue/form_field.cc
parent6b92e04f5f151c896e3088e86f70db7081009308 (diff)
downloadexternal_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.zip
external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.gz
external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.bz2
Merge Chromium at r12.0.742.93: Initial merge by git
Change-Id: Ic5ee2fec31358bbee305f7e915442377bfa6cda6
Diffstat (limited to 'webkit/glue/form_field.cc')
-rw-r--r--webkit/glue/form_field.cc72
1 files changed, 36 insertions, 36 deletions
diff --git a/webkit/glue/form_field.cc b/webkit/glue/form_field.cc
index 82cac6a..0de8446 100644
--- a/webkit/glue/form_field.cc
+++ b/webkit/glue/form_field.cc
@@ -20,41 +20,41 @@ using WebKit::WebVector;
namespace webkit_glue {
FormField::FormField()
- : max_length_(0),
- is_autofilled_(false) {
+ : max_length(0),
+ is_autofilled(false) {
}
// TODO(jhawkins): This constructor should probably be deprecated and the
// functionality moved to FormManager.
FormField::FormField(WebFormControlElement element)
- : max_length_(0),
- is_autofilled_(false) {
- name_ = element.nameForAutofill();
+ : max_length(0),
+ is_autofilled(false) {
+ name = element.nameForAutofill();
// TODO(jhawkins): Extract the field label. For now we just use the field
// name.
- label_ = name_;
+ label = name;
- form_control_type_ = element.formControlType();
- if (form_control_type_ == ASCIIToUTF16("text")) {
+ form_control_type = element.formControlType();
+ if (form_control_type == ASCIIToUTF16("text")) {
const WebInputElement& input_element = element.toConst<WebInputElement>();
- value_ = input_element.value();
- max_length_ = input_element.size();
- is_autofilled_ = input_element.isAutofilled();
- } else if (form_control_type_ == ASCIIToUTF16("select-one")) {
+ value = input_element.value();
+ 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();
+ value = select_element.value();
// For select-one elements copy option strings.
WebVector<WebElement> list_items = select_element.listItems();
- option_strings_.reserve(list_items.size());
+ option_strings.reserve(list_items.size());
for (size_t i = 0; i < list_items.size(); ++i) {
if (list_items[i].hasTagName("option"))
- option_strings_.push_back(list_items[i].to<WebOptionElement>().value());
+ option_strings.push_back(list_items[i].to<WebOptionElement>().value());
}
}
- TrimWhitespace(value_, TRIM_LEADING, &value_);
+ TrimWhitespace(value, TRIM_LEADING, &value);
}
FormField::FormField(const string16& label,
@@ -63,12 +63,12 @@ FormField::FormField(const string16& label,
const string16& form_control_type,
int max_length,
bool is_autofilled)
- : label_(label),
- name_(name),
- value_(value),
- form_control_type_(form_control_type),
- max_length_(max_length),
- is_autofilled_(is_autofilled) {
+ : label(label),
+ name(name),
+ value(value),
+ form_control_type(form_control_type),
+ max_length(max_length),
+ is_autofilled(is_autofilled) {
}
FormField::~FormField() {
@@ -77,10 +77,10 @@ FormField::~FormField() {
bool FormField::operator==(const FormField& field) const {
// A FormField stores a value, but the value is not part of the identity of
// the field, so we don't want to compare the values.
- return (label_ == field.label_ &&
- name_ == field.name_ &&
- form_control_type_ == field.form_control_type_ &&
- max_length_ == field.max_length_);
+ return (label == field.label &&
+ name == field.name &&
+ form_control_type == field.form_control_type &&
+ max_length == field.max_length);
}
bool FormField::operator!=(const FormField& field) const {
@@ -88,24 +88,24 @@ bool FormField::operator!=(const FormField& field) const {
}
bool FormField::StrictlyEqualsHack(const FormField& field) const {
- return (label_ == field.label_ &&
- name_ == field.name_ &&
- value_ == field.value_ &&
- form_control_type_ == field.form_control_type_ &&
- max_length_ == field.max_length_);
+ return (label == field.label &&
+ name == field.name &&
+ value == field.value &&
+ form_control_type == field.form_control_type &&
+ max_length == field.max_length);
}
std::ostream& operator<<(std::ostream& os, const FormField& field) {
return os
- << UTF16ToUTF8(field.label())
+ << UTF16ToUTF8(field.label)
<< " "
- << UTF16ToUTF8(field.name())
+ << UTF16ToUTF8(field.name)
<< " "
- << UTF16ToUTF8(field.value())
+ << UTF16ToUTF8(field.value)
<< " "
- << UTF16ToUTF8(field.form_control_type())
+ << UTF16ToUTF8(field.form_control_type)
<< " "
- << field.max_length();
+ << field.max_length;
}
} // namespace webkit_glue