Chromium Code Reviews| 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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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->original_signon_realm = form->signon_realm; |
| 618 form->signon_realm = lookup_form->signon_realm; | 618 form->signon_realm = lookup_form->signon_realm; |
| 619 form->origin = lookup_form->origin; | |
|
vabr (Chromium)
2015/08/28 10:47:23
Do you remove this to be able to update it correct
dvadym
2015/08/28 11:25:28
Good point, it influences PSL scoring, but current
vabr (Chromium)
2015/08/28 11:38:41
Yes, it is fine to adapt the scoring, but we shoul
| |
| 620 } | 619 } |
| 621 SecretValue* secretValue = secret_item_get_secret(secretItem); | 620 SecretValue* secretValue = secret_item_get_secret(secretItem); |
| 622 if (secretValue) { | 621 if (secretValue) { |
| 623 form->password_value = UTF8ToUTF16(secret_value_get_text(secretValue)); | 622 form->password_value = UTF8ToUTF16(secret_value_get_text(secretValue)); |
| 624 secret_value_unref(secretValue); | 623 secret_value_unref(secretValue); |
| 625 } else { | 624 } else { |
| 626 LOG(WARNING) << "Unable to access password from list element!"; | 625 LOG(WARNING) << "Unable to access password from list element!"; |
| 627 } | 626 } |
| 628 forms.push_back(form.Pass()); | 627 forms.push_back(form.Pass()); |
| 629 } else { | 628 } else { |
| 630 VLOG(1) << "Could not initialize PasswordForm from attributes!"; | 629 VLOG(1) << "Could not initialize PasswordForm from attributes!"; |
| 631 } | 630 } |
| 632 } | 631 } |
| 633 | 632 |
| 634 if (lookup_form) { | 633 if (lookup_form) { |
| 635 const GURL signon_realm(lookup_form->signon_realm); | 634 const GURL signon_realm(lookup_form->signon_realm); |
| 636 std::string registered_domain = | 635 std::string registered_domain = |
| 637 password_manager::GetRegistryControlledDomain(signon_realm); | 636 password_manager::GetRegistryControlledDomain(signon_realm); |
| 638 UMA_HISTOGRAM_ENUMERATION( | 637 UMA_HISTOGRAM_ENUMERATION( |
| 639 "PasswordManager.PslDomainMatchTriggering", | 638 "PasswordManager.PslDomainMatchTriggering", |
| 640 password_manager::ShouldPSLDomainMatchingApply(registered_domain) | 639 password_manager::ShouldPSLDomainMatchingApply(registered_domain) |
| 641 ? psl_domain_match_metric | 640 ? psl_domain_match_metric |
| 642 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, | 641 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, |
| 643 password_manager::PSL_DOMAIN_MATCH_COUNT); | 642 password_manager::PSL_DOMAIN_MATCH_COUNT); |
| 644 } | 643 } |
| 645 g_list_free(found); | 644 g_list_free(found); |
| 646 return forms.Pass(); | 645 return forms.Pass(); |
| 647 } | 646 } |
| OLD | NEW |