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/content/renderer/password_form_conversion_utils.h" | 5 #include "components/autofill/content/renderer/password_form_conversion_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 UMA_HISTOGRAM_COUNTS_100( | 587 UMA_HISTOGRAM_COUNTS_100( |
588 "PasswordManager.EmptyUsernames.TextAndPasswordFieldCount", | 588 "PasswordManager.EmptyUsernames.TextAndPasswordFieldCount", |
589 layout_sequence.size()); | 589 layout_sequence.size()); |
590 // For comparison, also report the number of password fields. | 590 // For comparison, also report the number of password fields. |
591 UMA_HISTOGRAM_COUNTS_100( | 591 UMA_HISTOGRAM_COUNTS_100( |
592 "PasswordManager.EmptyUsernames.PasswordFieldCount", | 592 "PasswordManager.EmptyUsernames.PasswordFieldCount", |
593 std::count(layout_sequence.begin(), layout_sequence.end(), 'P')); | 593 std::count(layout_sequence.begin(), layout_sequence.end(), 'P')); |
594 } | 594 } |
595 | 595 |
596 password_form->scheme = PasswordForm::SCHEME_HTML; | 596 password_form->scheme = PasswordForm::SCHEME_HTML; |
597 password_form->ssl_valid = false; | |
598 password_form->preferred = false; | 597 password_form->preferred = false; |
599 password_form->blacklisted_by_user = false; | 598 password_form->blacklisted_by_user = false; |
600 password_form->type = PasswordForm::TYPE_MANUAL; | 599 password_form->type = PasswordForm::TYPE_MANUAL; |
601 | 600 |
602 // The password form is considered that it looks like SignUp form if it has | 601 // The password form is considered that it looks like SignUp form if it has |
603 // more than 1 text field with user input or it has a new password field and | 602 // more than 1 text field with user input or it has a new password field and |
604 // no current password field. | 603 // no current password field. |
605 password_form->does_look_like_signup_form = | 604 password_form->does_look_like_signup_form = |
606 number_of_non_empty_text_non_password_fields > 1 || | 605 number_of_non_empty_text_non_password_fields > 1 || |
607 (number_of_non_empty_text_non_password_fields == 1 && | 606 (number_of_non_empty_text_non_password_fields == 1 && |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 } | 698 } |
700 | 699 |
701 bool HasAutocompleteAttributeValue(const blink::WebInputElement& element, | 700 bool HasAutocompleteAttributeValue(const blink::WebInputElement& element, |
702 const char* value_in_lowercase) { | 701 const char* value_in_lowercase) { |
703 return base::LowerCaseEqualsASCII( | 702 return base::LowerCaseEqualsASCII( |
704 base::StringPiece16(element.getAttribute("autocomplete")), | 703 base::StringPiece16(element.getAttribute("autocomplete")), |
705 value_in_lowercase); | 704 value_in_lowercase); |
706 } | 705 } |
707 | 706 |
708 } // namespace autofill | 707 } // namespace autofill |
OLD | NEW |