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

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

Issue 2937033002: [Password Generation] Send a boolean flag of whether user changed generated password (Closed)
Patch Set: UMA fix Created 3 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
Index: components/password_manager/core/browser/password_manager.cc
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
index 804aa5d4348ce113c20c7fc59ab3fa4754090ce6..5a27fd005f5d519451a8a82ac1cf6abb121fe0e2 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -197,27 +197,23 @@ void PasswordManager::OnPresaveGeneratedPassword(
DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage());
PasswordFormManager* form_manager = GetMatchingPendingManager(form);
if (form_manager) {
- form_manager->form_saver()->PresaveGeneratedPassword(form);
+ form_manager->PresaveGeneratedPassword(form);
+ UMA_HISTOGRAM_BOOLEAN("PasswordManager.GeneratedFormHasNoFormManager",
vabr (Chromium) 2017/06/16 12:32:29 Could you test setting the histograms in the unitt
kolos1 2017/06/21 13:46:12 Let me do it in a separate CL. I believe it is not
kolos1 2017/06/21 13:48:13 ooops, I actually added tests for that in password
+ false);
return;
}
+
+ UMA_HISTOGRAM_BOOLEAN("PasswordManager.GeneratedFormHasNoFormManager", true);
}
-void PasswordManager::SetHasGeneratedPasswordForForm(
- password_manager::PasswordManagerDriver* driver,
- const PasswordForm& form,
- bool password_is_generated) {
+void PasswordManager::OnPasswordNoLongerGenerated(const PasswordForm& form) {
DCHECK(client_->IsSavingAndFillingEnabledForCurrentPage());
PasswordFormManager* form_manager = GetMatchingPendingManager(form);
if (form_manager) {
- if (!password_is_generated)
- form_manager->form_saver()->RemovePresavedPassword();
- form_manager->set_has_generated_password(password_is_generated);
+ form_manager->PasswordNoLongerGenerated();
vabr (Chromium) 2017/06/16 12:32:29 Is there a way to test that this forwarding to Pas
kolos1 2017/06/21 13:46:12 I believe this forwarding is already tested indire
vabr (Chromium) 2017/06/21 14:18:33 "wouldn't work" assumes that our specification of
return;
}
-
- UMA_HISTOGRAM_BOOLEAN("PasswordManager.GeneratedFormHasNoFormManager",
- password_is_generated);
}
void PasswordManager::SetGenerationElementAndReasonForForm(

Powered by Google App Engine
This is Rietveld 408576698