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

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

Issue 2086483002: Fix the signature of PasswordFormManager::UpdateMetadataForUsage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/core/browser/password_form_manager.h ('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/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 05d4f85e8f229f581576c1b86c3485277b623cb8..10145b9e807786487ea1534a99c612e610d613cc 100644
--- a/components/password_manager/core/browser/password_form_manager.cc
+++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -138,6 +138,16 @@ bool ShouldShowInitialPasswordAccountSuggestions() {
base::CompareCase::SENSITIVE);
}
+// Update |credential| to reflect usage. This is broken out from UpdateLogin()
+// so that PSL matches can also be properly updated.
+void UpdateMetadataForUsage(PasswordForm* credential) {
+ ++credential->times_used;
+
+ // Remove alternate usernames. At this point we assume that we have found
+ // the right username.
+ credential->other_possible_usernames.clear();
+}
+
} // namespace
PasswordFormManager::PasswordFormManager(
@@ -728,7 +738,7 @@ void PasswordFormManager::UpdateLogin() {
return;
}
- UpdateMetadataForUsage(pending_credentials_);
+ UpdateMetadataForUsage(&pending_credentials_);
client_->GetStoreResultFilter()->ReportFormUsed(pending_credentials_);
@@ -795,15 +805,6 @@ void PasswordFormManager::UpdateLogin() {
}
}
-void PasswordFormManager::UpdateMetadataForUsage(
- const PasswordForm& credential) {
- ++pending_credentials_.times_used;
-
- // Remove alternate usernames. At this point we assume that we have found
- // the right username.
- pending_credentials_.other_possible_usernames.clear();
-}
-
bool PasswordFormManager::UpdatePendingCredentialsIfOtherPossibleUsername(
const base::string16& username) {
for (PasswordFormMap::const_iterator it = best_matches_.begin();
@@ -1098,7 +1099,7 @@ void PasswordFormManager::CreatePendingCredentials() {
// TODO(gcasto): It would be nice if other state were shared such that if
// say a password was updated on one match it would update on all related
// passwords. This is a much larger change.
- UpdateMetadataForUsage(pending_credentials_);
+ UpdateMetadataForUsage(&pending_credentials_);
// Update |pending_credentials_| in order to be able correctly save it.
pending_credentials_.origin = provisionally_saved_form_->origin;
« no previous file with comments | « components/password_manager/core/browser/password_form_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698