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; ...@@ -15,6 +15,10 @@ typedef autofill::SavePasswordProgressLogger Logger;
namespace password_manager { namespace password_manager {
// URL Keyed Metrics.
const char kUkmUserModifiedPasswordField[] = "UserModifiedPasswordField";
const char kUkmProvisionalSaveFailure[] = "ProvisionalSaveFailure";
PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder( PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder(
std::unique_ptr<ukm::UkmEntryBuilder> ukm_entry_builder) std::unique_ptr<ukm::UkmEntryBuilder> ukm_entry_builder)
: ukm_entry_builder_(std::move(ukm_entry_builder)) {} : ukm_entry_builder_(std::move(ukm_entry_builder)) {}
...@@ -24,7 +28,7 @@ PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder( ...@@ -24,7 +28,7 @@ PasswordManagerMetricsRecorder::PasswordManagerMetricsRecorder(
PasswordManagerMetricsRecorder::~PasswordManagerMetricsRecorder() { PasswordManagerMetricsRecorder::~PasswordManagerMetricsRecorder() {
if (user_modified_password_field_) if (user_modified_password_field_)
RecordUkmMetric("UserModifiedPasswordField", 1); RecordUkmMetric(kUkmUserModifiedPasswordField, 1);
} }
PasswordManagerMetricsRecorder& PasswordManagerMetricsRecorder::operator=( PasswordManagerMetricsRecorder& PasswordManagerMetricsRecorder::operator=(
...@@ -51,6 +55,7 @@ void PasswordManagerMetricsRecorder::RecordProvisionalSaveFailure( ...@@ -51,6 +55,7 @@ void PasswordManagerMetricsRecorder::RecordProvisionalSaveFailure(
BrowserSavePasswordProgressLogger* logger) { BrowserSavePasswordProgressLogger* logger) {
UMA_HISTOGRAM_ENUMERATION("PasswordManager.ProvisionalSaveFailure", failure, UMA_HISTOGRAM_ENUMERATION("PasswordManager.ProvisionalSaveFailure", failure,
MAX_FAILURE_VALUE); MAX_FAILURE_VALUE);
RecordUkmMetric(kUkmProvisionalSaveFailure, static_cast<int64_t>(failure));
if (logger) { if (logger) {
switch (failure) { switch (failure) {
......
...@@ -21,7 +21,11 @@ namespace password_manager { ...@@ -21,7 +21,11 @@ namespace password_manager {
// Records a 1 for every page on which a user has modified the content of a // 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 // password field - regardless of how many password fields a page contains or
// the user modifies. // 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; class BrowserSavePasswordProgressLogger;
...@@ -35,13 +39,24 @@ class PasswordManagerMetricsRecorder { ...@@ -35,13 +39,24 @@ class PasswordManagerMetricsRecorder {
// Reasons why the password manager failed to do a provisional saving and // Reasons why the password manager failed to do a provisional saving and
// therefore did not offer the user to save a password. // therefore did not offer the user to save a password.
enum ProvisionalSaveFailure { enum ProvisionalSaveFailure {
// Password manager is disabled or user is in incognito mode.
SAVING_DISABLED, SAVING_DISABLED,
// Submitted form contains an empty password.
EMPTY_PASSWORD, EMPTY_PASSWORD,
// No PasswordFormManager exists for this form.
NO_MATCHING_FORM, NO_MATCHING_FORM,
// FormFetcher of PasswordFormManager is still loading.
MATCHING_NOT_COMPLETE, MATCHING_NOT_COMPLETE,
// Form is blacklisted for saving. Obsolete since M47.
FORM_BLACKLISTED, FORM_BLACKLISTED,
// <unknown purpose>. Obsolete since M48.
INVALID_FORM, 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, 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, SAVING_ON_HTTP_AFTER_HTTPS,
MAX_FAILURE_VALUE MAX_FAILURE_VALUE
}; };
......
...@@ -928,6 +928,13 @@ be describing additional metrics about the same event. ...@@ -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 interactions with them. No events are created for pages that don't contain
password forms. password forms.
</summary> </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"> <metric name="UserModifiedPasswordField">
<summary> <summary>
Records a 1 for every page on which a user has modified a password text 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