Commit d904bbaa authored by Dominic Battre's avatar Dominic Battre Committed by Commit Bot

Record UKMs for failing to provisionally save a password form

Bug: 732846
Change-Id: I011b4805a15501df0fb32ac3fd6002e44a56d9c2
Reviewed-on: https://chromium-review.googlesource.com/575242
Commit-Queue: Dominic Battré <battre@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488173}
parent cec5fdea
......@@ -15,6 +15,10 @@ typedef autofill::SavePasswordProgressLogger Logger;
namespace password_manager {
// URL Keyed Metrics.
const char kUkmUserModifiedPasswordField[] = "UserModifiedPasswordField";
const char kUkmProvisionalSaveFailure[] = "ProvisionalSaveFailure";
PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder(
std::unique_ptr<ukm::UkmEntryBuilder> ukm_entry_builder)
: ukm_entry_builder_(std::move(ukm_entry_builder)) {}
......@@ -24,7 +28,7 @@ PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder(
PasswordManagerMetricsRecorder::~PasswordManagerMetricsRecorder() {
if (user_modified_password_field_)
RecordUkmMetric("UserModifiedPasswordField", 1);
RecordUkmMetric(kUkmUserModifiedPasswordField, 1);
}
PasswordManagerMetricsRecorder& PasswordManagerMetricsRecorder::operator=(
......@@ -51,6 +55,7 @@ void PasswordManagerMetricsRecorder::RecordProvisionalSaveFailure(
BrowserSavePasswordProgressLogger* logger) {
UMA_HISTOGRAM_ENUMERATION("PasswordManager.ProvisionalSaveFailure", failure,
MAX_FAILURE_VALUE);
RecordUkmMetric(kUkmProvisionalSaveFailure, static_cast<int64_t>(failure));
if (logger) {
switch (failure) {
......
......@@ -21,7 +21,11 @@ namespace password_manager {
// Records a 1 for every page on which a user has modified the content of a
// password field - regardless of how many password fields a page contains or
// the user modifies.
constexpr char kUkmUserModifiedPasswordField[] = "UserModifiedPasswordField";
extern const char kUkmUserModifiedPasswordField[];
// UKM that records a ProvisionalSaveFailure in case the password manager cannot
// offer to save a credential.
extern const char kUkmProvisionalSaveFailure[];
class BrowserSavePasswordProgressLogger;
......@@ -35,13 +39,24 @@ class PasswordManagerMetricsRecorder {
// Reasons why the password manager failed to do a provisional saving and
// therefore did not offer the user to save a password.
enum ProvisionalSaveFailure {
// Password manager is disabled or user is in incognito mode.
SAVING_DISABLED,
// Submitted form contains an empty password.
EMPTY_PASSWORD,
// No PasswordFormManager exists for this form.
NO_MATCHING_FORM,
// FormFetcher of PasswordFormManager is still loading.
MATCHING_NOT_COMPLETE,
// Form is blacklisted for saving. Obsolete since M47.
FORM_BLACKLISTED,
// <unknown purpose>. Obsolete since M48.
INVALID_FORM,
// A Google credential cannot be saved by policy because it is the Chrome
// Sync credential and therefore acts as a master password that gives access
// to all other credentials on https://passwords.google.com.
SYNC_CREDENTIAL,
// Credentials are not offered to be saved on HTTP pages if a credential is
// stored for the corresponding HTTPS page.
SAVING_ON_HTTP_AFTER_HTTPS,
MAX_FAILURE_VALUE
};
......
......@@ -928,6 +928,13 @@ be describing additional metrics about the same event.
interactions with them. No events are created for pages that don't contain
password forms.
</summary>
<metric name="ProvisionalSaveFailure">
<summary>
Records a provisional save failure in case the password manager cannot
offer to save a credential. Recorded values correspond to the enum
PasswordManagerMetricsRecorder::ProvisionalSaveFailure.
</summary>
</metric>
<metric name="UserModifiedPasswordField">
<summary>
Records a 1 for every page on which a user has modified a password text
......
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