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

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

Issue 2523593006: Show PSL-matched credentials in the account chooser. (Closed)
Patch Set: nit Created 4 years, 1 month 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
« no previous file with comments | « components/password_manager/core/browser/credential_manager_pending_request_task.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/test_password_store.cc
diff --git a/components/password_manager/core/browser/test_password_store.cc b/components/password_manager/core/browser/test_password_store.cc
index f84d597ffb2064ffbcda7f62c15dec5c5a848c15..fc70489e21056dc9594e9ea43c6066beabdd4e15 100644
--- a/components/password_manager/core/browser/test_password_store.cc
+++ b/components/password_manager/core/browser/test_password_store.cc
@@ -86,13 +86,18 @@ std::vector<std::unique_ptr<autofill::PasswordForm>>
TestPasswordStore::FillMatchingLogins(const FormDigest& form) {
std::vector<std::unique_ptr<autofill::PasswordForm>> matched_forms;
for (const auto& elements : stored_passwords_) {
- if (elements.first == form.signon_realm ||
+ const bool realm_matches = elements.first == form.signon_realm;
+ const bool realm_psl_matches =
+ IsPublicSuffixDomainMatch(elements.first, form.signon_realm);
+ if (realm_matches || realm_psl_matches ||
(form.scheme == autofill::PasswordForm::SCHEME_HTML &&
- password_manager::IsFederatedMatch(elements.first, form.origin)) ||
- IsPublicSuffixDomainMatch(elements.first, form.signon_realm)) {
- for (const auto& stored_form : elements.second)
+ password_manager::IsFederatedMatch(elements.first, form.origin))) {
+ const bool is_psl = !realm_matches && realm_psl_matches;
+ for (const auto& stored_form : elements.second) {
matched_forms.push_back(
base::MakeUnique<autofill::PasswordForm>(stored_form));
+ matched_forms.back()->is_public_suffix_match = is_psl;
+ }
}
}
return matched_forms;
« no previous file with comments | « components/password_manager/core/browser/credential_manager_pending_request_task.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698