| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/autofill/core/common/form_field_data.h" | 5 #include "components/autofill/core/common/form_field_data.h" |
| 6 | 6 |
| 7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "components/autofill/core/common/autofill_util.h" | 10 #include "components/autofill/core/common/autofill_util.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 role == field.role && text_direction == field.text_direction; | 152 role == field.role && text_direction == field.text_direction; |
| 153 // The option values/contents which are the list of items in the list | 153 // The option values/contents which are the list of items in the list |
| 154 // of a drop-down are currently not considered part of the identity of | 154 // of a drop-down are currently not considered part of the identity of |
| 155 // a form element. This is debatable, since one might base heuristics | 155 // a form element. This is debatable, since one might base heuristics |
| 156 // on the types of elements that are available. Alternatively, one | 156 // on the types of elements that are available. Alternatively, one |
| 157 // could imagine some forms that dynamically change the element | 157 // could imagine some forms that dynamically change the element |
| 158 // contents (say, insert years starting from the current year) that | 158 // contents (say, insert years starting from the current year) that |
| 159 // should not be considered changes in the structure of the form. | 159 // should not be considered changes in the structure of the form. |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool FormFieldData::SimilarFieldAs(const FormFieldData& field) const { |
| 163 return label == field.label && name == field.name && id == field.id && |
| 164 form_control_type == field.form_control_type && |
| 165 IsCheckable(check_status) == IsCheckable(field.check_status); |
| 166 } |
| 167 |
| 162 bool FormFieldData::operator==(const FormFieldData& field) const { | 168 bool FormFieldData::operator==(const FormFieldData& field) const { |
| 163 return SameFieldAs(field) && is_autofilled == field.is_autofilled && | 169 return SameFieldAs(field) && is_autofilled == field.is_autofilled && |
| 164 check_status == field.check_status && | 170 check_status == field.check_status && |
| 165 option_values == field.option_values && | 171 option_values == field.option_values && |
| 166 option_contents == field.option_contents && | 172 option_contents == field.option_contents && |
| 167 properties_mask == field.properties_mask; | 173 properties_mask == field.properties_mask; |
| 168 } | 174 } |
| 169 | 175 |
| 170 bool FormFieldData::operator!=(const FormFieldData& field) const { | 176 bool FormFieldData::operator!=(const FormFieldData& field) const { |
| 171 return !(*this == field); | 177 return !(*this == field); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 << " " << field.autocomplete_attribute << " " << field.placeholder | 375 << " " << field.autocomplete_attribute << " " << field.placeholder |
| 370 << " " << field.max_length << " " << field.css_classes << " " | 376 << " " << field.max_length << " " << field.css_classes << " " |
| 371 << (field.is_autofilled ? "true" : "false") << " " | 377 << (field.is_autofilled ? "true" : "false") << " " |
| 372 << check_status_str << (field.is_focusable ? "true" : "false") | 378 << check_status_str << (field.is_focusable ? "true" : "false") |
| 373 << " " << (field.should_autocomplete ? "true" : "false") << " " | 379 << " " << (field.should_autocomplete ? "true" : "false") << " " |
| 374 << role_str << " " << field.text_direction << " " | 380 << role_str << " " << field.text_direction << " " |
| 375 << field.properties_mask; | 381 << field.properties_mask; |
| 376 } | 382 } |
| 377 | 383 |
| 378 } // namespace autofill | 384 } // namespace autofill |
| OLD | NEW |