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

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

Issue 1371713002: [Autofill] Return early when no new forms are parsed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 5 years, 2 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
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 return;
1399
1397 std::vector<FormStructure*> non_queryable_forms; 1400 std::vector<FormStructure*> non_queryable_forms;
1398 for (const FormData& form : forms) { 1401 for (const FormData& form : forms) {
1399 scoped_ptr<FormStructure> form_structure(new FormStructure(form)); 1402 scoped_ptr<FormStructure> form_structure(new FormStructure(form));
1400 1403
1401 if (!form_structure->ShouldBeParsed()) { 1404 if (!form_structure->ShouldBeParsed()) {
1402 if (form_structure->has_password_field()) { 1405 if (form_structure->has_password_field()) {
1403 AutofillMetrics::LogPasswordFormQueryVolume( 1406 AutofillMetrics::LogPasswordFormQueryVolume(
1404 AutofillMetrics::NEW_PASSWORD_QUERY); 1407 AutofillMetrics::NEW_PASSWORD_QUERY);
1405 } 1408 }
1406 continue; 1409 continue;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 if (i > 0) 1560 if (i > 0)
1558 fputs("Next oldest form:\n", file); 1561 fputs("Next oldest form:\n", file);
1559 } 1562 }
1560 fputs("\n", file); 1563 fputs("\n", file);
1561 1564
1562 fclose(file); 1565 fclose(file);
1563 } 1566 }
1564 #endif // ENABLE_FORM_DEBUG_DUMP 1567 #endif // ENABLE_FORM_DEBUG_DUMP
1565 1568
1566 } // namespace autofill 1569 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698