diff options
author | Ben Murdoch <benm@google.com> | 2011-01-07 14:59:53 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-01-11 14:17:07 +0000 |
commit | 6eef37161f9d4fde23b1b87a5bb26dfcf1a55c8c (patch) | |
tree | c65c196d4f4191dea69edb4434f96f39e8de3e33 /WebKit/android/WebCoreSupport/autofill | |
parent | ba15e2278b62f3c1df84f0e8ed9e2a536b7b5c5e (diff) | |
download | external_webkit-6eef37161f9d4fde23b1b87a5bb26dfcf1a55c8c.zip external_webkit-6eef37161f9d4fde23b1b87a5bb26dfcf1a55c8c.tar.gz external_webkit-6eef37161f9d4fde23b1b87a5bb26dfcf1a55c8c.tar.bz2 |
Merge Chromium at 9.0.597.55: Merge r67599 (1/2)
This is a slightly tricky merge. This first part is the easy bit.
See http://src.chromium.org/viewvc/chrome?view=rev&revision=67599
Change-Id: Id22f7f0ce0f0b7eca62f39d4e6ae65b9ea1bdcda
Diffstat (limited to 'WebKit/android/WebCoreSupport/autofill')
3 files changed, 14 insertions, 5 deletions
diff --git a/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.cpp b/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.cpp index defe881..6af0875 100644 --- a/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.cpp +++ b/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.cpp @@ -52,13 +52,15 @@ using namespace WebCore::HTMLNames; namespace webkit_glue { FormField::FormField() - : max_length_(0) { + : max_length_(0), + is_autofilled_(false) { } // TODO: This constructor should probably be deprecated and the // functionality moved to FormManager. FormField::FormField(const HTMLFormControlElement& element) - : max_length_(0) { + : max_length_(0), + is_autofilled_(false) { name_ = nameForAutoFill(element); // TODO: Extract the field label. For now we just use the field @@ -70,6 +72,7 @@ FormField::FormField(const HTMLFormControlElement& element) const HTMLInputElement& input_element = static_cast<const HTMLInputElement&>(element); value_ = WTFStringToString16(input_element.value()); max_length_ = input_element.size(); + is_autofilled_ = input_element.isAutofilled(); } else if (form_control_type_ == kSelectOne) { const HTMLSelectElement& const_select_element = static_cast<const HTMLSelectElement&>(element); HTMLSelectElement& select_element = const_cast<HTMLSelectElement&>(const_select_element); @@ -87,12 +90,13 @@ FormField::FormField(const HTMLFormControlElement& element) TrimWhitespace(value_, TRIM_LEADING, &value_); } -FormField::FormField(const string16& label, const string16& name, const string16& value, const string16& form_control_type, int max_length) +FormField::FormField(const string16& label, const string16& name, const string16& value, 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) { + max_length_(max_length), + is_autofilled_(is_autofilled) { } FormField::~FormField() { diff --git a/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.h b/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.h index 14f9cae..c5e3ecc 100644 --- a/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.h +++ b/WebKit/android/WebCoreSupport/autofill/FormFieldAndroid.h @@ -45,7 +45,7 @@ class FormField { public: FormField(); explicit FormField(const WebCore::HTMLFormControlElement& element); - FormField(const string16& label, const string16& name, const string16& value, const string16& form_control_type, int max_length); + FormField(const string16& label, const string16& name, const string16& value, const string16& form_control_type, int max_length, bool is_autofilled); virtual ~FormField(); const string16& label() const { return label_; } @@ -53,6 +53,8 @@ public: const string16& value() const { return value_; } const string16& form_control_type() const { return form_control_type_; } int max_length() const { return max_length_; } + bool is_autofilled() const { return is_autofilled_; } + // Returns option string for elements for which they make sense (select-one, // for example) for the rest of elements return an empty array. const std::vector<string16>& option_strings() const { return option_strings_; } @@ -62,6 +64,7 @@ public: void set_value(const string16& value) { value_ = value; } void set_form_control_type(const string16& form_control_type) { form_control_type_ = form_control_type; } void set_max_length(int max_length) { max_length_ = max_length; } + void set_autofilled(bool is_autofilled) { is_autofilled_ = is_autofilled; } void set_option_strings(const std::vector<string16>& strings) { option_strings_ = strings; } // Equality tests for identity which does not include |value_| or |size_|. @@ -81,6 +84,7 @@ private: string16 value_; string16 form_control_type_; int max_length_; + bool is_autofilled_; std::vector<string16> option_strings_; }; diff --git a/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp b/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp index 1ba42b8..d30918f 100644 --- a/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp +++ b/WebKit/android/WebCoreSupport/autofill/FormManagerAndroid.cpp @@ -319,6 +319,7 @@ void FormManager::HTMLFormControlElementToFormField(HTMLFormControlElement* elem if (formControlType(*element) == kText) { HTMLInputElement* input_element = static_cast<HTMLInputElement*>(element); field->set_max_length(input_element->maxLength()); + field->set_autofilled(input_element->isAutofilled()); } if (!(extract_mask & EXTRACT_VALUE)) |