Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: components/password_manager/core/browser/login_database.cc

Issue 269813012: [Password Manager] Remove PSL matching for non-HTML forms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/login_database.cc
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc
index a65bf05509bd412527089d12fae5a7c73a0afd9f..fea970287e5bab58ca16a73bec6511758e8e0c72 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -436,7 +436,8 @@ bool LoginDatabase::GetLogins(const PasswordForm& form,
PSLMatchingHelper::GetRegistryControlledDomain(signon_realm);
PSLMatchingHelper::PSLDomainMatchMetric psl_domain_match_metric =
PSLMatchingHelper::PSL_DOMAIN_MATCH_NONE;
- if (psl_helper_.ShouldPSLDomainMatchingApply(registered_domain)) {
+ if (form.scheme == PasswordForm::SCHEME_HTML &&
+ psl_helper_.ShouldPSLDomainMatchingApply(registered_domain)) {
// We are extending the original SQL query with one that includes more
// possible matches based on public suffix domain matching. Using a regexp
// here is just an optimization to not have to parse all the stored entries
@@ -480,8 +481,9 @@ bool LoginDatabase::GetLogins(const PasswordForm& form,
continue;
DCHECK(result == ENCRYPTION_RESULT_SUCCESS);
if (psl_helper_.IsMatchingEnabled()) {
- if (!PSLMatchingHelper::IsPublicSuffixDomainMatch(new_form->signon_realm,
- form.signon_realm)) {
+ if (new_form->scheme != PasswordForm::SCHEME_HTML ||
+ !PSLMatchingHelper::IsPublicSuffixDomainMatch(new_form->signon_realm,
+ form.signon_realm)) {
// The database returned results that should not match. Skipping result.
continue;
}

Powered by Google App Engine
This is Rietveld 408576698