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

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

Issue 1723583003: CREDENTIAL: Filter affiliated credentials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: vabr@ Created 4 years, 10 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
« no previous file with comments | « components/password_manager/content/browser/credential_manager_dispatcher_unittest.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/credential_manager_pending_request_task.cc
diff --git a/components/password_manager/core/browser/credential_manager_pending_request_task.cc b/components/password_manager/core/browser/credential_manager_pending_request_task.cc
index 6414ec3cdab9c22851f3642f8b0f4e1d6be703ba..4dc39485f0c533412f7b9e32be367f2ea5b7ce26 100644
--- a/components/password_manager/core/browser/credential_manager_pending_request_task.cc
+++ b/components/password_manager/core/browser/credential_manager_pending_request_task.cc
@@ -49,17 +49,21 @@ void CredentialManagerPendingRequestTask::OnGetPasswordStoreResults(
ScopedVector<autofill::PasswordForm> affiliated_results;
ScopedVector<autofill::PasswordForm> federated_results;
for (auto& form : results) {
+ // Ensure that the form we're looking at matches the password and
+ // federation filters provided.
+ if (!((form->federation_url.is_empty() && include_passwords_) ||
+ (!form->federation_url.is_empty() &&
+ federations_.count(form->federation_url.spec())))) {
+ continue;
+ }
+
// PasswordFrom and GURL have different definition of origin.
// PasswordForm definition: scheme, host, port and path.
// GURL definition: scheme, host, and port.
// So we can't compare them directly.
if (form->origin.GetOrigin() == origin_.GetOrigin()) {
- if ((form->federation_url.is_empty() && include_passwords_) ||
- (!form->federation_url.is_empty() &&
- federations_.count(form->federation_url.spec()))) {
- local_results.push_back(form);
- form = nullptr;
- }
+ local_results.push_back(form);
+ form = nullptr;
} else if (affiliated_realms_.count(form->signon_realm) &&
AffiliatedMatchHelper::IsValidAndroidCredential(*form)) {
form->is_affiliation_based_match = true;
@@ -76,9 +80,6 @@ void CredentialManagerPendingRequestTask::OnGetPasswordStoreResults(
}
if (!affiliated_results.empty()) {
- // TODO(mkwst): This doesn't create a PasswordForm that we can use to create
- // a FederatedCredential (via CreatePasswordFormFromCredentialInfo). We need
- // to fix that.
password_manager_util::TrimUsernameOnlyCredentials(&affiliated_results);
local_results.insert(local_results.end(), affiliated_results.begin(),
affiliated_results.end());
« no previous file with comments | « components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698