| Index: chrome/browser/password_manager/native_backend_gnome_x.cc
|
| diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc
|
| index 9dcf47502caa52daebbc7d3dd4ffffdb6637cb0c..a51f1d3613023aad14c72c7829e344a3b0659849 100644
|
| --- a/chrome/browser/password_manager/native_backend_gnome_x.cc
|
| +++ b/chrome/browser/password_manager/native_backend_gnome_x.cc
|
| @@ -31,6 +31,7 @@ using base::UTF8ToUTF16;
|
| using base::UTF16ToUTF8;
|
| using content::BrowserThread;
|
| using namespace password_manager::metrics_util;
|
| +using password_manager::MatchResult;
|
| using password_manager::PasswordStore;
|
|
|
| namespace {
|
| @@ -121,45 +122,48 @@ std::vector<std::unique_ptr<PasswordForm>> ConvertFormList(
|
| std::vector<std::unique_ptr<PasswordForm>> forms;
|
| password_manager::PSLDomainMatchMetric psl_domain_match_metric =
|
| password_manager::PSL_DOMAIN_MATCH_NONE;
|
| - const bool allow_psl_match =
|
| - lookup_form && password_manager::ShouldPSLDomainMatchingApply(
|
| - password_manager::GetRegistryControlledDomain(
|
| - GURL(lookup_form->signon_realm)));
|
| for (GList* element = g_list_first(found); element;
|
| element = g_list_next(element)) {
|
| GnomeKeyringFound* data = static_cast<GnomeKeyringFound*>(element->data);
|
| GnomeKeyringAttributeList* attrs = data->attributes;
|
|
|
| std::unique_ptr<PasswordForm> form(FormFromAttributes(attrs));
|
| - if (form) {
|
| - if (lookup_form && form->signon_realm != lookup_form->signon_realm) {
|
| - if (lookup_form->scheme != PasswordForm::SCHEME_HTML ||
|
| - form->scheme != PasswordForm::SCHEME_HTML)
|
| - continue; // Ignore non-HTML matches.
|
| - // This is not an exact match, we try PSL matching and federated match.
|
| - if (allow_psl_match &&
|
| - password_manager::IsPublicSuffixDomainMatch(
|
| - form->signon_realm, lookup_form->signon_realm)) {
|
| + if (!form) {
|
| + LOG(WARNING) << "Could not initialize PasswordForm from attributes!";
|
| + continue;
|
| + }
|
| +
|
| + if (lookup_form) {
|
| + switch (GetMatchResult(*form, *lookup_form)) {
|
| + case MatchResult::NO_MATCH:
|
| + continue;
|
| + case MatchResult::EXACT_MATCH:
|
| + break;
|
| + case MatchResult::PSL_MATCH:
|
| psl_domain_match_metric = password_manager::PSL_DOMAIN_MATCH_FOUND;
|
| form->is_public_suffix_match = true;
|
| - } else if (!form->federation_origin.unique() &&
|
| - password_manager::IsFederatedMatch(form->signon_realm,
|
| - lookup_form->origin)) {
|
| - } else {
|
| - continue;
|
| - }
|
| - }
|
| - if (data->secret) {
|
| - form->password_value = UTF8ToUTF16(data->secret);
|
| - } else {
|
| - LOG(WARNING) << "Unable to access password from list element!";
|
| + break;
|
| + case MatchResult::FEDERATED_MATCH:
|
| + break;
|
| + case MatchResult::FEDERATED_PSL_MATCH:
|
| + psl_domain_match_metric =
|
| + password_manager::PSL_DOMAIN_MATCH_FOUND_FEDERATED;
|
| + form->is_public_suffix_match = true;
|
| + break;
|
| }
|
| - forms.push_back(std::move(form));
|
| + }
|
| +
|
| + if (data->secret) {
|
| + form->password_value = UTF8ToUTF16(data->secret);
|
| } else {
|
| - LOG(WARNING) << "Could not initialize PasswordForm from attributes!";
|
| + LOG(WARNING) << "Unable to access password from list element!";
|
| }
|
| + forms.push_back(std::move(form));
|
| }
|
| if (lookup_form) {
|
| + const bool allow_psl_match = password_manager::ShouldPSLDomainMatchingApply(
|
| + password_manager::GetRegistryControlledDomain(
|
| + GURL(lookup_form->signon_realm)));
|
| UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering",
|
| allow_psl_match
|
| ? psl_domain_match_metric
|
|
|