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

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

Issue 1385563007: Do not allow federated logins saved from Android apps to be affiliated matches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment. Created 5 years, 2 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/password_store.cc
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc
index 001c97c336d76d9837cb4ec3040ab95b2f9a4b74..82ff912f523b57f997bff1f222ea78fe0671d8b5 100644
--- a/components/password_manager/core/browser/password_store.cc
+++ b/components/password_manager/core/browser/password_store.cc
@@ -384,6 +384,10 @@ void PasswordStore::GetLoginsWithAffiliationsImpl(
android_form.signon_realm = realm;
ScopedVector<PasswordForm> more_results(
FillMatchingLogins(android_form, DISALLOW_PROMPT));
+ ScopedVector<PasswordForm>::iterator it_first_federated = std::partition(
+ more_results.begin(), more_results.end(),
+ [](PasswordForm* form) { return form->federation_url.is_empty(); });
+ more_results.erase(it_first_federated, more_results.end());
results.insert(results.end(), more_results.begin(), more_results.end());
more_results.weak_clear();
}

Powered by Google App Engine
This is Rietveld 408576698