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

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

Issue 1315323003: Clean the blacklisted form if a user saves a password. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2490
Patch Set: Created 5 years, 4 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 | « no previous file | components/password_manager/core/browser/password_form_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/password_form_manager.cc
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc
index 8c1217bf556810bd0e890bf0cbd705bec9588b9e..0f31815ab9948fe0470ae383a986679c5954c8bf 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -190,17 +190,18 @@ void PasswordFormManager::PermanentlyBlacklist() {
DCHECK(!client_->IsOffTheRecord());
// Configure the form about to be saved for blacklist status.
- autofill::PasswordForm blacklisted = pending_credentials_;
- blacklisted.preferred = false;
- blacklisted.blacklisted_by_user = true;
- blacklisted.username_value.clear();
- blacklisted.password_value.clear();
- blacklisted.other_possible_usernames.clear();
- blacklisted.date_created = Time::Now();
+ blacklisted_matches_.push_back(
+ new autofill::PasswordForm(pending_credentials_));
+ blacklisted_matches_.back()->preferred = false;
+ blacklisted_matches_.back()->blacklisted_by_user = true;
+ blacklisted_matches_.back()->username_value.clear();
+ blacklisted_matches_.back()->password_value.clear();
+ blacklisted_matches_.back()->other_possible_usernames.clear();
+ blacklisted_matches_.back()->date_created = Time::Now();
PasswordStore* password_store = client_->GetPasswordStore();
DCHECK(password_store);
- password_store->AddLogin(blacklisted);
+ password_store->AddLogin(*blacklisted_matches_.back());
}
bool PasswordFormManager::IsNewLogin() const {
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_form_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698