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

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

Issue 2132063002: Implement origin-based deletion for password manager's auto-signin bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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_default.cc
diff --git a/components/password_manager/core/browser/password_store_default.cc b/components/password_manager/core/browser/password_store_default.cc
index 79cae2a78be01cd160f1c0522dbb9c270e5c0b6a..4dfe5159542640e9bc8d4a651e43f4445392fe41 100644
--- a/components/password_manager/core/browser/password_store_default.cc
+++ b/components/password_manager/core/browser/password_store_default.cc
@@ -135,16 +135,20 @@ PasswordStoreChangeList PasswordStoreDefault::RemoveLoginsSyncedBetweenImpl(
return changes;
}
-PasswordStoreChangeList
-PasswordStoreDefault::DisableAutoSignInForAllLoginsImpl() {
+PasswordStoreChangeList PasswordStoreDefault::DisableAutoSignInForOriginsImpl(
+ const base::Callback<bool(const GURL&)>& origin_filter) {
ScopedVector<autofill::PasswordForm> forms;
PasswordStoreChangeList changes;
if (login_db_ && login_db_->GetAutoSignInLogins(&forms)) {
- if (login_db_->DisableAutoSignInForAllLogins()) {
- for (const auto* form : forms) {
- changes.push_back(
- PasswordStoreChange(PasswordStoreChange::UPDATE, *form));
- }
+ for (const auto* form : forms) {
+ if (!origin_filter.Run(form->origin))
+ continue;
+
+ if (!login_db_->DisableAutoSignInForOrigin(form->origin))
vabr (Chromium) 2016/07/08 19:22:03 This looks rather inefficient. Did you consider ju
msramek 2016/07/11 13:09:17 Indeed, I did the change with the expectation that
+ continue;
+
+ changes.push_back(
+ PasswordStoreChange(PasswordStoreChange::UPDATE, *form));
}
}
return changes;

Powered by Google App Engine
This is Rietveld 408576698