summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/password_manager/core/browser/password_manager_metrics_util.cc28
-rw-r--r--components/password_manager/core/browser/password_manager_metrics_util.h39
2 files changed, 67 insertions, 0 deletions
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.cc b/components/password_manager/core/browser/password_manager_metrics_util.cc
index b7ac87c..6026705 100644
--- a/components/password_manager/core/browser/password_manager_metrics_util.cc
+++ b/components/password_manager/core/browser/password_manager_metrics_util.cc
@@ -115,4 +115,32 @@ std::string GroupIdToString(size_t group_id) {
return std::string();
}
+void LogUIDismissalReason(ResponseType type) {
+ UIDismissalReason reason = NO_DIRECT_INTERACTION;
+ switch (type) {
+ case NO_RESPONSE:
+ reason = NO_DIRECT_INTERACTION;
+ break;
+ case REMEMBER_PASSWORD:
+ reason = CLICKED_SAVE;
+ break;
+ case NEVER_REMEMBER_PASSWORD:
+ reason = CLICKED_NEVER;
+ break;
+ case INFOBAR_DISMISSED:
+ reason = CLICKED_NOPE;
+ break;
+ case NUM_RESPONSE_TYPES:
+ NOTREACHED();
+ break;
+ }
+ LogUIDismissalReason(reason);
+}
+
+void LogUIDismissalReason(UIDismissalReason reason) {
+ UMA_HISTOGRAM_ENUMERATION("PasswordManager.UIDismissalReason",
+ reason,
+ NUM_UI_RESPONSES);
+}
+
} // namespace password_manager_metrics_util
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.h b/components/password_manager/core/browser/password_manager_metrics_util.h
index e3166af..7ce1da1 100644
--- a/components/password_manager/core/browser/password_manager_metrics_util.h
+++ b/components/password_manager/core/browser/password_manager_metrics_util.h
@@ -11,6 +11,33 @@ class PrefService;
namespace password_manager_metrics_util {
+// Metrics: "PasswordManager.InfoBarResponse"
+enum ResponseType {
+ NO_RESPONSE = 0,
+ REMEMBER_PASSWORD,
+ NEVER_REMEMBER_PASSWORD,
+ INFOBAR_DISMISSED,
+ NUM_RESPONSE_TYPES,
+};
+
+// Metrics: "PasswordManager.UIResponse"
+enum UIDismissalReason {
+ // We use this to mean both "Bubble lost focus" and "No interaction with the
+ // infobar", depending on which experiment is active.
+ NO_DIRECT_INTERACTION = 0,
+ CLICKED_SAVE,
+ CLICKED_NOPE,
+ CLICKED_NEVER,
+ CLICKED_MANAGE,
+ CLICKED_DONE,
+ NUM_UI_RESPONSES,
+
+ // If we add the omnibox icon _without_ intending to display the bubble,
+ // we actually call Close() after creating the bubble view. We don't want
+ // that to count in the metrics, so we need this placeholder value.
+ NOT_DISPLAYED
+};
+
// We monitor the performance of the save password heuristic for a handful of
// domains. For privacy reasons we are not reporting UMA signals by domain, but
// by a domain group. A domain group can contain multiple domains, and a domain
@@ -41,6 +68,18 @@ void LogUMAHistogramBoolean(const std::string& name, bool sample);
// |group_id| corresponds to an unmonitored domain returns an empty string.
std::string GroupIdToString(size_t group_id);
+// Log the |reason| a user dismissed the password manager UI.
+void LogUIDismissalReason(UIDismissalReason reason);
+
+// Given a ResponseType, log the appropriate UIResponse. We'll use this
+// mapping to migrate from "PasswordManager.InfoBarResponse" to
+// "PasswordManager.UIDismissalReason" so we can accurately evaluate the
+// impact of the bubble UI.
+//
+// TODO(mkwst): Drop this (and the infobar metric itself) once the new metric
+// has rolled out to stable.
+void LogUIDismissalReason(ResponseType type);
+
} // namespace password_manager_metrics_util
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_METRICS_UTIL_H_