OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "chrome/browser/password_manager/native_backend_libsecret.h" | 5 #include "chrome/browser/password_manager/native_backend_libsecret.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 if (form) { | 607 if (form) { |
608 if (lookup_form && form->signon_realm != lookup_form->signon_realm) { | 608 if (lookup_form && form->signon_realm != lookup_form->signon_realm) { |
609 // This is not an exact match, we try PSL matching. | 609 // This is not an exact match, we try PSL matching. |
610 if (lookup_form->scheme != PasswordForm::SCHEME_HTML || | 610 if (lookup_form->scheme != PasswordForm::SCHEME_HTML || |
611 form->scheme != PasswordForm::SCHEME_HTML || | 611 form->scheme != PasswordForm::SCHEME_HTML || |
612 !(password_manager::IsPublicSuffixDomainMatch( | 612 !(password_manager::IsPublicSuffixDomainMatch( |
613 lookup_form->signon_realm, form->signon_realm))) { | 613 lookup_form->signon_realm, form->signon_realm))) { |
614 continue; | 614 continue; |
615 } | 615 } |
616 psl_domain_match_metric = password_manager::PSL_DOMAIN_MATCH_FOUND; | 616 psl_domain_match_metric = password_manager::PSL_DOMAIN_MATCH_FOUND; |
617 form->original_signon_realm = form->signon_realm; | 617 form->is_public_suffix_match = true; |
618 form->signon_realm = lookup_form->signon_realm; | |
619 form->origin = lookup_form->origin; | |
620 } | 618 } |
621 SecretValue* secretValue = secret_item_get_secret(secretItem); | 619 SecretValue* secretValue = secret_item_get_secret(secretItem); |
622 if (secretValue) { | 620 if (secretValue) { |
623 form->password_value = UTF8ToUTF16(secret_value_get_text(secretValue)); | 621 form->password_value = UTF8ToUTF16(secret_value_get_text(secretValue)); |
624 secret_value_unref(secretValue); | 622 secret_value_unref(secretValue); |
625 } else { | 623 } else { |
626 LOG(WARNING) << "Unable to access password from list element!"; | 624 LOG(WARNING) << "Unable to access password from list element!"; |
627 } | 625 } |
628 forms.push_back(form.Pass()); | 626 forms.push_back(form.Pass()); |
629 } else { | 627 } else { |
630 VLOG(1) << "Could not initialize PasswordForm from attributes!"; | 628 VLOG(1) << "Could not initialize PasswordForm from attributes!"; |
631 } | 629 } |
632 } | 630 } |
633 | 631 |
634 if (lookup_form) { | 632 if (lookup_form) { |
635 const GURL signon_realm(lookup_form->signon_realm); | 633 const GURL signon_realm(lookup_form->signon_realm); |
636 std::string registered_domain = | 634 std::string registered_domain = |
637 password_manager::GetRegistryControlledDomain(signon_realm); | 635 password_manager::GetRegistryControlledDomain(signon_realm); |
638 UMA_HISTOGRAM_ENUMERATION( | 636 UMA_HISTOGRAM_ENUMERATION( |
639 "PasswordManager.PslDomainMatchTriggering", | 637 "PasswordManager.PslDomainMatchTriggering", |
640 password_manager::ShouldPSLDomainMatchingApply(registered_domain) | 638 password_manager::ShouldPSLDomainMatchingApply(registered_domain) |
641 ? psl_domain_match_metric | 639 ? psl_domain_match_metric |
642 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, | 640 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, |
643 password_manager::PSL_DOMAIN_MATCH_COUNT); | 641 password_manager::PSL_DOMAIN_MATCH_COUNT); |
644 } | 642 } |
645 g_list_free(found); | 643 g_list_free(found); |
646 return forms.Pass(); | 644 return forms.Pass(); |
647 } | 645 } |
OLD | NEW |