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

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

Issue 1960653002: Fix blacklisting password forms with Credential Manager API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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/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 afcd8c2af5f0f5c1a0aadb87b036711b83e862c2..3eba949071c8ee705115dbfcd027b0cf829dfe52 100644
--- a/components/password_manager/core/browser/test_password_store.cc
+++ b/components/password_manager/core/browser/test_password_store.cc
@@ -8,6 +8,7 @@
#include "base/thread_task_runner_handle.h"
#include "components/autofill/core/common/password_form.h"
+#include "components/password_manager/core/browser/psl_matching_helper.h"
#include "components/password_manager/core/browser/statistics_table.h"
namespace password_manager {
@@ -83,10 +84,13 @@ PasswordStoreChangeList TestPasswordStore::RemoveLoginImpl(
ScopedVector<autofill::PasswordForm> TestPasswordStore::FillMatchingLogins(
const autofill::PasswordForm& form) {
ScopedVector<autofill::PasswordForm> matched_forms;
- std::vector<autofill::PasswordForm> forms =
- stored_passwords_[form.signon_realm];
- for (const auto& stored_form : forms) {
- matched_forms.push_back(new autofill::PasswordForm(stored_form));
+ for (const auto& elements : stored_passwords_) {
+ if (elements.first == form.signon_realm ||
+ (form.scheme == autofill::PasswordForm::SCHEME_HTML &&
+ password_manager::IsFederatedMatch(elements.first, form.origin))) {
+ for (const auto& stored_form : elements.second)
+ matched_forms.push_back(new autofill::PasswordForm(stored_form));
+ }
}
return matched_forms;
}

Powered by Google App Engine
This is Rietveld 408576698