Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: components/autofill/core/browser/form_structure.cc

Issue 2073093002: [Password Generation] Sends CSS classes inside autofill proto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed useless FormStructure recreation in FormStructureTest.EncodeUploadRequest_WithCssClasses Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_test_utils.cc ('k') | components/autofill/core/browser/form_structure_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698