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/browser/form_structure.h" | 5 #include "components/autofill/core/browser/form_structure.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 | 1174 |
1175 if (!field->label.empty()) { | 1175 if (!field->label.empty()) { |
1176 std::string truncated; | 1176 std::string truncated; |
1177 base::TruncateUTF8ToByteSize(base::UTF16ToUTF8(field->label), | 1177 base::TruncateUTF8ToByteSize(base::UTF16ToUTF8(field->label), |
1178 kMaxFieldLabelNumChars, &truncated); | 1178 kMaxFieldLabelNumChars, &truncated); |
1179 added_field->set_label(truncated); | 1179 added_field->set_label(truncated); |
1180 } | 1180 } |
1181 | 1181 |
1182 if (!field->autocomplete_attribute.empty()) | 1182 if (!field->autocomplete_attribute.empty()) |
1183 added_field->set_autocomplete(field->autocomplete_attribute); | 1183 added_field->set_autocomplete(field->autocomplete_attribute); |
| 1184 |
| 1185 if (!field->css_classes.empty()) |
| 1186 added_field->set_css_classes(base::UTF16ToUTF8(field->css_classes)); |
1184 } | 1187 } |
1185 } | 1188 } |
1186 } | 1189 } |
1187 } | 1190 } |
1188 | 1191 |
1189 uint64_t FormStructure::Hash64Bit(const std::string& str) { | 1192 uint64_t FormStructure::Hash64Bit(const std::string& str) { |
1190 std::string hash_bin = base::SHA1HashString(str); | 1193 std::string hash_bin = base::SHA1HashString(str); |
1191 DCHECK_EQ(base::kSHA1Length, hash_bin.length()); | 1194 DCHECK_EQ(base::kSHA1Length, hash_bin.length()); |
1192 | 1195 |
1193 uint64_t hash64 = (((static_cast<uint64_t>(hash_bin[0])) & 0xFF) << 56) | | 1196 uint64_t hash64 = (((static_cast<uint64_t>(hash_bin[0])) & 0xFF) << 56) | |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 filtered_strings[0].at(prefix_len)) { | 1368 filtered_strings[0].at(prefix_len)) { |
1366 // Mismatch found. | 1369 // Mismatch found. |
1367 return filtered_strings[i].substr(0, prefix_len); | 1370 return filtered_strings[i].substr(0, prefix_len); |
1368 } | 1371 } |
1369 } | 1372 } |
1370 } | 1373 } |
1371 return filtered_strings[0]; | 1374 return filtered_strings[0]; |
1372 } | 1375 } |
1373 | 1376 |
1374 } // namespace autofill | 1377 } // namespace autofill |
OLD | NEW |