diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 23:51:24 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 23:51:24 +0000 |
commit | 45c6e53a2c50e19a3f79fcc6f05914793ed93de6 (patch) | |
tree | e4f0c22f63fe5197938dc868f00c7d6a8e2ea8a6 /webkit/glue/form_field.cc | |
parent | cffa2055808bf2149ce48118dcacde477b7ead60 (diff) | |
download | chromium_src-45c6e53a2c50e19a3f79fcc6f05914793ed93de6.zip chromium_src-45c6e53a2c50e19a3f79fcc6f05914793ed93de6.tar.gz chromium_src-45c6e53a2c50e19a3f79fcc6f05914793ed93de6.tar.bz2 |
FormFieldValues -> FormData consolidation: Use webkit_glue::FormField to store field data in FormData instead of storing the field data separately in the struct.
BUG=33032
TEST=none
Review URL: http://codereview.chromium.org/847002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/form_field.cc')
-rw-r--r-- | webkit/glue/form_field.cc | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/webkit/glue/form_field.cc b/webkit/glue/form_field.cc index 56f057f..721b3a7 100644 --- a/webkit/glue/form_field.cc +++ b/webkit/glue/form_field.cc @@ -1,10 +1,11 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "webkit/glue/form_field.h" #include "base/string_util.h" +#include "base/utf_string_conversions.h" using WebKit::WebInputElement; @@ -39,13 +40,30 @@ FormField::FormField(const string16& label, input_type_(input_type) { } -bool FormField::operator!=(const FormField& field) { +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_ || - input_type_ != field.input_type_); + return (label_ == field.label_ && + name_ == field.name_ && + form_control_type_ == field.form_control_type_ && + input_type_ == field.input_type_); +} + +bool FormField::operator!=(const FormField& field) const { + return !operator==(field); +} + +std::ostream& operator<<(std::ostream& os, const FormField& field) { + return os + << UTF16ToUTF8(field.label()) + << " " + << UTF16ToUTF8(field.name()) + << " " + << UTF16ToUTF8(field.value()) + << " " + << UTF16ToUTF8(field.form_control_type()) + << " " + << field.input_type(); } } // namespace webkit_glue |