Commit 946f221e authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Add UKM metrics for password submission indicator.

The CL is created in response to https://chromium-review.googlesource.com/c/chromium/src/+/1057235
SubmissionIndicatorEvent is already recorded via UMA. It indicates the event that made the password manager believe that there was a submission. The UKM is to be recorded only when a password is saved. It means that the submission detectioln was probably correct.

Bug: 842643
Change-Id: Ic381ee93de7459d7d942a9ee1b27d43e39095fc7
Reviewed-on: https://chromium-review.googlesource.com/1060034Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarDominic Battré <battre@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559236}
parent ab72aee0
......@@ -386,6 +386,8 @@ void PasswordFormManager::Save() {
metrics_util::LogPasswordAcceptedSaveUpdateSubmissionIndicatorEvent(
submitted_form_->submission_event);
metrics_recorder_->SetSubmissionIndicatorEvent(
submitted_form_->submission_event);
if ((user_action_ == UserAction::kNone) &&
DidPreferenceChange(best_matches_, pending_credentials_.username_value)) {
......@@ -421,6 +423,8 @@ void PasswordFormManager::Update(
const autofill::PasswordForm& credentials_to_update) {
metrics_util::LogPasswordAcceptedSaveUpdateSubmissionIndicatorEvent(
submitted_form_->submission_event);
metrics_recorder_->SetSubmissionIndicatorEvent(
submitted_form_->submission_event);
if (observed_form_.IsPossibleChangePasswordForm()) {
FormStructure form_structure(credentials_to_update.form_data);
UploadPasswordVote(observed_form_, autofill::NEW_PASSWORD,
......
......@@ -200,6 +200,11 @@ void PasswordFormMetricsRecorder::SetSubmittedFormType(
submitted_form_type_ = form_type;
}
void PasswordFormMetricsRecorder::SetSubmissionIndicatorEvent(
autofill::PasswordForm::SubmissionIndicatorEvent event) {
ukm_entry_builder_.SetSubmission_Indicator(static_cast<int>(event));
}
int PasswordFormMetricsRecorder::GetActionsTakenNew() const {
// Merge kManagerActionNone and kManagerActionBlacklisted_Obsolete. This
// lowers the number of histogram buckets used by 33%.
......
......@@ -194,6 +194,11 @@ class PasswordFormMetricsRecorder
// Call this once the submitted form type has been determined.
void SetSubmittedFormType(SubmittedFormType form_type);
// Call this when a password is saved to indicate which path led to
// submission.
void SetSubmissionIndicatorEvent(
autofill::PasswordForm::SubmissionIndicatorEvent event);
// Records all histograms in the PasswordManager.SuppressedAccount.* family.
// Takes the FormFetcher intance which owns the login data from PasswordStore.
// |pending_credentials| stores credentials when the form was submitted but
......
......@@ -2197,6 +2197,14 @@ be describing additional metrics about the same event.
correspond to the enum PasswordFormMetricsRecorder::BubbleTrigger.
</summary>
</metric>
<metric name="Submission.Indicator">
<summary>
Records the event that led the password manager to believe the submission
was successful. Metrics is recorded only when the password is saved.
Recorded values correspond to the enum
autofill::PasswordForm::SubmissionIndicatorEvent.
</summary>
</metric>
<metric name="Submission.Observed">
<summary>
Records whether a submission of a password form has been observered. The
......
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