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/autofill_manager.h" | 5 #include "components/autofill/core/browser/autofill_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1387 std::vector<Suggestion> suggestions = | 1387 std::vector<Suggestion> suggestions = |
1388 personal_data_->GetCreditCardSuggestions(type, field.value); | 1388 personal_data_->GetCreditCardSuggestions(type, field.value); |
1389 for (size_t i = 0; i < suggestions.size(); i++) { | 1389 for (size_t i = 0; i < suggestions.size(); i++) { |
1390 suggestions[i].frontend_id = | 1390 suggestions[i].frontend_id = |
1391 MakeFrontendID(suggestions[i].backend_id, std::string()); | 1391 MakeFrontendID(suggestions[i].backend_id, std::string()); |
1392 } | 1392 } |
1393 return suggestions; | 1393 return suggestions; |
1394 } | 1394 } |
1395 | 1395 |
1396 void AutofillManager::ParseForms(const std::vector<FormData>& forms) { | 1396 void AutofillManager::ParseForms(const std::vector<FormData>& forms) { |
1397 if (forms.empty()) { | |
1398 // The renderer doesn't have any forms to parse. | |
Evan Stade
2015/09/26 00:09:16
I don't think this comment adds much, the early re
Mathieu
2015/09/26 14:12:58
Done.
| |
1399 return; | |
1400 } | |
1401 | |
1397 std::vector<FormStructure*> non_queryable_forms; | 1402 std::vector<FormStructure*> non_queryable_forms; |
1398 for (const FormData& form : forms) { | 1403 for (const FormData& form : forms) { |
1399 scoped_ptr<FormStructure> form_structure(new FormStructure(form)); | 1404 scoped_ptr<FormStructure> form_structure(new FormStructure(form)); |
1400 | 1405 |
1401 if (!form_structure->ShouldBeParsed()) { | 1406 if (!form_structure->ShouldBeParsed()) { |
1402 if (form_structure->has_password_field()) { | 1407 if (form_structure->has_password_field()) { |
1403 AutofillMetrics::LogPasswordFormQueryVolume( | 1408 AutofillMetrics::LogPasswordFormQueryVolume( |
1404 AutofillMetrics::NEW_PASSWORD_QUERY); | 1409 AutofillMetrics::NEW_PASSWORD_QUERY); |
1405 } | 1410 } |
1406 continue; | 1411 continue; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1557 if (i > 0) | 1562 if (i > 0) |
1558 fputs("Next oldest form:\n", file); | 1563 fputs("Next oldest form:\n", file); |
1559 } | 1564 } |
1560 fputs("\n", file); | 1565 fputs("\n", file); |
1561 | 1566 |
1562 fclose(file); | 1567 fclose(file); |
1563 } | 1568 } |
1564 #endif // ENABLE_FORM_DEBUG_DUMP | 1569 #endif // ENABLE_FORM_DEBUG_DUMP |
1565 | 1570 |
1566 } // namespace autofill | 1571 } // namespace autofill |
OLD | NEW |