Commit fed9c479 authored by Bettina's avatar Bettina Committed by Commit Bot

Only log SecurityEventRecorder ping when sent.

Bug: 999369
Change-Id: Idd673b572d979815d5bf15ff020d743af4eba86b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1796887
Commit-Queue: Bettina Dea <bdea@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695420}
parent 57aa1ff2
......@@ -660,9 +660,6 @@ void ChromePasswordProtectionService::
sync_pb::GaiaPasswordReuse gaia_password_reuse_event;
*gaia_password_reuse_event.mutable_reuse_lookup() = reuse_lookup;
WebUIInfoSingleton::GetInstance()->AddToSecurityEvents(
gaia_password_reuse_event);
auto* identity_manager = IdentityManagerFactory::GetForProfileIfExists(
profile_->GetOriginalProfile());
if (identity_manager) {
......@@ -671,6 +668,8 @@ void ChromePasswordProtectionService::
// SecurityEventRecorder only supports unconsented primary accounts.
if (gaia::AreEmailsSame(unconsented_primary_account_info.email,
username_for_last_shown_warning())) {
WebUIInfoSingleton::GetInstance()->AddToSecurityEvents(
gaia_password_reuse_event);
SecurityEventRecorderFactory::GetForProfile(profile_)
->RecordGaiaPasswordReuse(gaia_password_reuse_event);
}
......
......@@ -654,8 +654,6 @@ TEST_F(ChromePasswordProtectionServiceTest,
// multiple prefs and doesn't add much verification value.
}
// TODO(crbug/914410): Renable once we know the SecurityEventRecorder won't
// crash Chrome.
TEST_F(ChromePasswordProtectionServiceTest,
VerifyPasswordReuseDetectedSecurityEventRecorded) {
identity_test_env()->SetPrimaryAccount(kTestEmail);
......
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