OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_form_manager.h" | 5 #include "components/password_manager/core/browser/password_form_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
703 // to cut down on false positives. Specifically a site may have multiple login | 703 // to cut down on false positives. Specifically a site may have multiple login |
704 // forms with different markup, which might look similar to a signup form. | 704 // forms with different markup, which might look similar to a signup form. |
705 if (pending.times_used == 1) { | 705 if (pending.times_used == 1) { |
706 FormStructure pending_structure(pending.form_data); | 706 FormStructure pending_structure(pending.form_data); |
707 FormStructure observed_structure(observed.form_data); | 707 FormStructure observed_structure(observed.form_data); |
708 // Ignore |pending_structure| if its FormData has no fields. This is to | 708 // Ignore |pending_structure| if its FormData has no fields. This is to |
709 // weed out those credentials that were saved before FormData was added | 709 // weed out those credentials that were saved before FormData was added |
710 // to PasswordForm. Even without this check, these FormStructure's won't | 710 // to PasswordForm. Even without this check, these FormStructure's won't |
711 // be uploaded, but it makes it hard to see if we are encountering | 711 // be uploaded, but it makes it hard to see if we are encountering |
712 // unexpected errors. | 712 // unexpected errors. |
713 if (!pending.form_data.fields.empty() && | 713 if (!pending.form_data.password.name.empty() && |
vabr (Chromium)
2014/10/13 12:30:53
This seems like a change in behaviour -- what abou
Pritam Nikam
2014/10/16 12:55:13
Done.
| |
714 pending_structure.FormSignature() != | 714 pending_structure.FormSignature() != |
715 observed_structure.FormSignature()) { | 715 observed_structure.FormSignature()) { |
716 UploadPasswordForm(pending.form_data, | 716 UploadPasswordForm(pending.form_data, |
717 autofill::ACCOUNT_CREATION_PASSWORD); | 717 autofill::ACCOUNT_CREATION_PASSWORD); |
718 } | 718 } |
719 } | 719 } |
720 } | 720 } |
721 | 721 |
722 void PasswordFormManager::UploadPasswordForm( | 722 void PasswordFormManager::UploadPasswordForm( |
723 const autofill::FormData& form_data, | 723 const autofill::FormData& form_data, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
795 LogPasswordGenerationSubmissionEvent(PASSWORD_SUBMITTED); | 795 LogPasswordGenerationSubmissionEvent(PASSWORD_SUBMITTED); |
796 } | 796 } |
797 | 797 |
798 void PasswordFormManager::SubmitFailed() { | 798 void PasswordFormManager::SubmitFailed() { |
799 submit_result_ = kSubmitResultFailed; | 799 submit_result_ = kSubmitResultFailed; |
800 if (has_generated_password_) | 800 if (has_generated_password_) |
801 LogPasswordGenerationSubmissionEvent(PASSWORD_SUBMISSION_FAILED); | 801 LogPasswordGenerationSubmissionEvent(PASSWORD_SUBMISSION_FAILED); |
802 } | 802 } |
803 | 803 |
804 } // namespace password_manager | 804 } // namespace password_manager |
OLD | NEW |