| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_GLUE_FORM_FIELD_H_ | 5 #ifndef WEBKIT_GLUE_FORM_FIELD_H_ |
| 6 #define WEBKIT_GLUE_FORM_FIELD_H_ | 6 #define WEBKIT_GLUE_FORM_FIELD_H_ |
| 7 | 7 |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebFormControlElement.h" |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 int size() const { return size_; } | 28 int size() const { return size_; } |
| 29 | 29 |
| 30 void set_label(const string16& label) { label_ = label; } | 30 void set_label(const string16& label) { label_ = label; } |
| 31 void set_name(const string16& name) { name_ = name; } | 31 void set_name(const string16& name) { name_ = name; } |
| 32 void set_value(const string16& value) { value_ = value; } | 32 void set_value(const string16& value) { value_ = value; } |
| 33 void set_form_control_type(const string16& form_control_type) { | 33 void set_form_control_type(const string16& form_control_type) { |
| 34 form_control_type_ = form_control_type; | 34 form_control_type_ = form_control_type; |
| 35 } | 35 } |
| 36 void set_size(int size) { size_ = size; } | 36 void set_size(int size) { size_ = size; } |
| 37 | 37 |
| 38 // Equality tests for identity which does not include |value_| or |size_|. |
| 39 // Use |StrictlyEqualsHack| method to test all members. |
| 40 // TODO(dhollowa): These operators need to be revised when we implement field |
| 41 // ids. |
| 38 bool operator==(const FormField& field) const; | 42 bool operator==(const FormField& field) const; |
| 39 bool operator!=(const FormField& field) const; | 43 bool operator!=(const FormField& field) const; |
| 40 | 44 |
| 45 // Test equality of all data members. |
| 46 // TODO(dhollowa): This will be removed when we implement field ids. |
| 47 bool StrictlyEqualsHack(const FormField& field) const; |
| 48 |
| 41 private: | 49 private: |
| 42 string16 label_; | 50 string16 label_; |
| 43 string16 name_; | 51 string16 name_; |
| 44 string16 value_; | 52 string16 value_; |
| 45 string16 form_control_type_; | 53 string16 form_control_type_; |
| 46 int size_; | 54 int size_; |
| 47 }; | 55 }; |
| 48 | 56 |
| 49 // So we can compare FormFields with EXPECT_EQ(). | 57 // So we can compare FormFields with EXPECT_EQ(). |
| 50 std::ostream& operator<<(std::ostream& os, const FormField& profile); | 58 std::ostream& operator<<(std::ostream& os, const FormField& profile); |
| 51 | 59 |
| 52 } // namespace webkit_glue | 60 } // namespace webkit_glue |
| 53 | 61 |
| 54 #endif // WEBKIT_GLUE_FORM_FIELD_H_ | 62 #endif // WEBKIT_GLUE_FORM_FIELD_H_ |
| OLD | NEW |