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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 if (HasAutocompleteAttributeValue(new_password, "new-password")) | 420 if (HasAutocompleteAttributeValue(new_password, "new-password")) |
421 password_form->new_password_marked_by_site = true; | 421 password_form->new_password_marked_by_site = true; |
422 } | 422 } |
423 | 423 |
424 if (username_element.isNull()) { | 424 if (username_element.isNull()) { |
425 // To get a better idea on how password forms without a username field | 425 // To get a better idea on how password forms without a username field |
426 // look like, report the total number of text and password fields. | 426 // look like, report the total number of text and password fields. |
427 UMA_HISTOGRAM_COUNTS_100( | 427 UMA_HISTOGRAM_COUNTS_100( |
428 "PasswordManager.EmptyUsernames.TextAndPasswordFieldCount", | 428 "PasswordManager.EmptyUsernames.TextAndPasswordFieldCount", |
429 layout_sequence.size()); | 429 layout_sequence.size()); |
| 430 // For comparison, also report the number of password fields. |
| 431 UMA_HISTOGRAM_COUNTS_100( |
| 432 "PasswordManager.EmptyUsernames.PasswordFieldCount", |
| 433 std::count(layout_sequence.begin(), layout_sequence.end(), 'P')); |
430 } | 434 } |
431 | 435 |
432 password_form->scheme = PasswordForm::SCHEME_HTML; | 436 password_form->scheme = PasswordForm::SCHEME_HTML; |
433 password_form->ssl_valid = false; | 437 password_form->ssl_valid = false; |
434 password_form->preferred = false; | 438 password_form->preferred = false; |
435 password_form->blacklisted_by_user = false; | 439 password_form->blacklisted_by_user = false; |
436 password_form->type = PasswordForm::TYPE_MANUAL; | 440 password_form->type = PasswordForm::TYPE_MANUAL; |
437 } | 441 } |
438 | 442 |
439 GURL StripAuthAndParams(const GURL& gurl) { | 443 GURL StripAuthAndParams(const GURL& gurl) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 WebFormElementToFormData(web_form, | 486 WebFormElementToFormData(web_form, |
483 blink::WebFormControlElement(), | 487 blink::WebFormControlElement(), |
484 EXTRACT_NONE, | 488 EXTRACT_NONE, |
485 &password_form->form_data, | 489 &password_form->form_data, |
486 NULL /* FormFieldData */); | 490 NULL /* FormFieldData */); |
487 | 491 |
488 return password_form.Pass(); | 492 return password_form.Pass(); |
489 } | 493 } |
490 | 494 |
491 } // namespace autofill | 495 } // namespace autofill |
OLD | NEW |