| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 AutofillQueryContents* query) { | 428 AutofillQueryContents* query) { |
| 429 DCHECK(encoded_signatures); | 429 DCHECK(encoded_signatures); |
| 430 encoded_signatures->clear(); | 430 encoded_signatures->clear(); |
| 431 encoded_signatures->reserve(forms.size()); | 431 encoded_signatures->reserve(forms.size()); |
| 432 | 432 |
| 433 query->set_client_version(kClientVersion); | 433 query->set_client_version(kClientVersion); |
| 434 | 434 |
| 435 // Some badly formatted web sites repeat forms - detect that and encode only | 435 // Some badly formatted web sites repeat forms - detect that and encode only |
| 436 // one form as returned data would be the same for all the repeated forms. | 436 // one form as returned data would be the same for all the repeated forms. |
| 437 std::set<std::string> processed_forms; | 437 std::set<std::string> processed_forms; |
| 438 for (const auto& form : forms) { | 438 for (auto* form : forms) { |
| 439 std::string signature(form->FormSignature()); | 439 std::string signature(form->FormSignature()); |
| 440 if (processed_forms.find(signature) != processed_forms.end()) | 440 if (processed_forms.find(signature) != processed_forms.end()) |
| 441 continue; | 441 continue; |
| 442 processed_forms.insert(signature); | 442 processed_forms.insert(signature); |
| 443 if (form->IsMalformed()) | 443 if (form->IsMalformed()) |
| 444 continue; | 444 continue; |
| 445 | 445 |
| 446 form->EncodeFormForQuery(query->add_form()); | 446 form->EncodeFormForQuery(query->add_form()); |
| 447 | 447 |
| 448 encoded_signatures->push_back(signature); | 448 encoded_signatures->push_back(signature); |
| (...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1368 filtered_strings[0].at(prefix_len)) { | 1368 filtered_strings[0].at(prefix_len)) { |
| 1369 // Mismatch found. | 1369 // Mismatch found. |
| 1370 return filtered_strings[i].substr(0, prefix_len); | 1370 return filtered_strings[i].substr(0, prefix_len); |
| 1371 } | 1371 } |
| 1372 } | 1372 } |
| 1373 } | 1373 } |
| 1374 return filtered_strings[0]; | 1374 return filtered_strings[0]; |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 } // namespace autofill | 1377 } // namespace autofill |
| OLD | NEW |