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

Side by Side Diff: components/password_manager/core/browser/password_generation_manager.cc

Issue 2318533002: [Password Generation] Use signatures for form matching (Closed)
Patch Set: Sent to review Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/password_manager/core/browser/password_generation_manager.h " 5 #include "components/password_manager/core/browser/password_generation_manager.h "
6 6
7 #include "components/autofill/core/browser/autofill_field.h" 7 #include "components/autofill/core/browser/autofill_field.h"
8 #include "components/autofill/core/browser/field_types.h" 8 #include "components/autofill/core/browser/field_types.h"
9 #include "components/autofill/core/browser/form_structure.h" 9 #include "components/autofill/core/browser/form_structure.h"
10 #include "components/autofill/core/common/password_form_generation_data.h" 10 #include "components/autofill/core/common/password_form_generation_data.h"
(...skipping 23 matching lines...) Expand all
34 forms.begin(); 34 forms.begin();
35 form_it != forms.end(); ++form_it) { 35 form_it != forms.end(); ++form_it) {
36 autofill::FormStructure* form = *form_it; 36 autofill::FormStructure* form = *form_it;
37 for (std::vector<autofill::AutofillField*>::const_iterator field_it = 37 for (std::vector<autofill::AutofillField*>::const_iterator field_it =
38 form->begin(); 38 form->begin();
39 field_it != form->end(); ++field_it) { 39 field_it != form->end(); ++field_it) {
40 autofill::AutofillField* field = *field_it; 40 autofill::AutofillField* field = *field_it;
41 if (field->server_type() == autofill::ACCOUNT_CREATION_PASSWORD || 41 if (field->server_type() == autofill::ACCOUNT_CREATION_PASSWORD ||
42 field->server_type() == autofill::NEW_PASSWORD) { 42 field->server_type() == autofill::NEW_PASSWORD) {
43 forms_eligible_for_generation.push_back( 43 forms_eligible_for_generation.push_back(
44 autofill::PasswordFormGenerationData{form->form_name(), 44 autofill::PasswordFormGenerationData{form->form_signature(),
45 form->target_url(), *field}); 45 field->FieldSignature()});
46 break; 46 break;
47 } 47 }
48 } 48 }
49 } 49 }
50 if (!forms_eligible_for_generation.empty()) 50 if (!forms_eligible_for_generation.empty())
51 driver_->FormsEligibleForGenerationFound(forms_eligible_for_generation); 51 driver_->FormsEligibleForGenerationFound(forms_eligible_for_generation);
52 } 52 }
53 53
54 // In order for password generation to be enabled, we need to make sure: 54 // In order for password generation to be enabled, we need to make sure:
55 // (1) Password sync is enabled, and 55 // (1) Password sync is enabled, and
(...skipping 14 matching lines...) Expand all
70 70
71 return true; 71 return true;
72 } 72 }
73 73
74 void PasswordGenerationManager::CheckIfFormClassifierShouldRun() { 74 void PasswordGenerationManager::CheckIfFormClassifierShouldRun() {
75 if (autofill::FormStructure::IsAutofillFieldMetadataEnabled()) 75 if (autofill::FormStructure::IsAutofillFieldMetadataEnabled())
76 driver_->AllowToRunFormClassifier(); 76 driver_->AllowToRunFormClassifier();
77 } 77 }
78 78
79 } // namespace password_manager 79 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698