summaryrefslogtreecommitdiff
path: root/chromium/components/password_manager/core/browser/password_form_metrics_recorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/password_manager/core/browser/password_form_metrics_recorder.h')
-rw-r--r--chromium/components/password_manager/core/browser/password_form_metrics_recorder.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/chromium/components/password_manager/core/browser/password_form_metrics_recorder.h b/chromium/components/password_manager/core/browser/password_form_metrics_recorder.h
index 4f82cc73e1d..f0d1916a989 100644
--- a/chromium/components/password_manager/core/browser/password_form_metrics_recorder.h
+++ b/chromium/components/password_manager/core/browser/password_form_metrics_recorder.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/optional.h"
#include "components/autofill/core/common/password_form.h"
#include "components/autofill/core/common/signatures_util.h"
#include "components/password_manager/core/browser/password_form_user_action.h"
@@ -157,6 +158,23 @@ class PasswordFormMetricsRecorder
kCorrectedUsernameInForm = 200,
};
+ // Old and new form parsings comparison result.
+ enum class ParsingComparisonResult {
+ kSame,
+ kDifferent,
+ // Old and new parsers use different identification mechanism for unnamed
+ // fields, so the difference in parsing of anonymous fields is expected.
+ kAnonymousFields,
+ kMax
+ };
+
+ // Indicator whether the user has seen a password generation popup and why.
+ enum class PasswordGenerationPopupShown {
+ kNotShown = 0,
+ kShownAutomatically = 1,
+ kShownManually = 2,
+ };
+
// The maximum number of combinations of the ManagerAction, UserAction and
// SubmitResult enums.
// This is used when recording the actions taken by the form in UMA.
@@ -182,6 +200,16 @@ class PasswordFormMetricsRecorder
// Stores whether the form has had its password auto generated by the browser.
void SetHasGeneratedPassword(bool has_generated_password);
+ // Stores whether the a generated password has been modified by the user.
+ void SetHasGeneratedPasswordChanged(bool has_changed_generated_password);
+
+ // Reports the priority of a PasswordGenerationRequirementsSpec for a
+ // generated password. This can be used for debugging as a 0 means that
+ // no spec was used, a 10 means that the spec came from autofill and was crowd
+ // sourced, a 20 means that it was overrideen per domain and a 30 means that
+ // is was overridden for the form.
+ void ReportSpecPriorityForGeneratedPassword(uint32_t spec_priority);
+
// Stores the password manager and user actions and logs them.
void SetManagerAction(ManagerAction manager_action);
void SetUserAction(UserAction user_action);
@@ -191,6 +219,10 @@ class PasswordFormMetricsRecorder
void LogSubmitPassed();
void LogSubmitFailed();
+ // This can be called multiple times in which case the last value is reported.
+ void SetPasswordGenerationPopupShown(bool generation_popup_was_shown,
+ bool is_manual_generation);
+
// Call this once the submitted form type has been determined.
void SetSubmittedFormType(SubmittedFormType form_type);
@@ -236,6 +268,10 @@ class PasswordFormMetricsRecorder
// distinguish two forms on the same site.
void RecordFormSignature(autofill::FormSignature form_signature);
+ // Records old and new form parsings comparison result.
+ void RecordParsingsComparisonResult(
+ ParsingComparisonResult comparison_result);
+
// Records that Chrome noticed that it should show a manual fallback for
// saving.
void RecordShowManualFallbackForSaving(bool has_generated_password,
@@ -296,6 +332,12 @@ class PasswordFormMetricsRecorder
// Whether this form has an auto generated password.
bool has_generated_password_ = false;
+ // Whether this form has an auto generated password that was modified by the
+ // user.
+ bool has_generated_password_changed_ = false;
+
+ base::Optional<uint32_t> spec_priority_of_generated_password_;
+
// Tracks which bubble is currently being displayed to the user.
CurrentBubbleOfInterest current_bubble_ = CurrentBubbleOfInterest::kNone;
@@ -305,6 +347,11 @@ class PasswordFormMetricsRecorder
// Whether the user was shown a prompt to save a new credential.
bool save_prompt_shown_ = false;
+ // Whether the user was shown a password generation popup and why.
+ // Only reportet when a popup was shown.
+ PasswordGenerationPopupShown password_generation_popup_shown_ =
+ PasswordGenerationPopupShown::kNotShown;
+
// These three fields record the "ActionsTaken" by the browser and
// the user with this form, and the result. They are combined and
// recorded in UMA when the PasswordFormMetricsRecorder is destroyed.