Commit 8c91b029 authored by Bettina's avatar Bettina Committed by Commit Bot

Log metric when password is first signed in.

Previously, SaveProtectedPasswordHash did not log
a metric when a password is saved into the hash
manager on first signed in.

Bug: 1032322
Change-Id: I66fca65496ccd5866536d954f60e4773d66d3a4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1959046Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Bettina Dea <bdea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723508}
parent 29087d72
......@@ -490,6 +490,8 @@ void PasswordStore::SaveProtectedPasswordHash(const std::string& username,
const base::string16& password,
bool is_gaia_password,
GaiaPasswordHashChange event) {
bool is_first_sign_in =
!hash_password_manager_.HasPasswordHash(username, is_gaia_password);
if (hash_password_manager_.SavePasswordHash(username, password,
is_gaia_password)) {
bool is_syncing =
......@@ -498,7 +500,8 @@ void PasswordStore::SaveProtectedPasswordHash(const std::string& username,
if (is_gaia_password) {
metrics_util::LogGaiaPasswordHashChange(event, is_syncing);
}
SchedulePasswordHashUpdate(/*should_log_metrics=*/false);
// Should log metrics if this is the first time saving the password hash.
SchedulePasswordHashUpdate(/*should_log_metrics=*/is_first_sign_in);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment