Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / components / password_manager / core / browser / password_manager_metrics_util.h
index e3166af..779d77d 100644 (file)
@@ -9,7 +9,48 @@
 
 class PrefService;
 
-namespace password_manager_metrics_util {
+namespace password_manager {
+
+namespace metrics_util {
+
+// Metrics: "PasswordManager.InfoBarResponse"
+enum ResponseType {
+  NO_RESPONSE = 0,
+  REMEMBER_PASSWORD,
+  NEVER_REMEMBER_PASSWORD,
+  INFOBAR_DISMISSED,
+  NUM_RESPONSE_TYPES,
+};
+
+// Metrics: "PasswordBubble.DisplayDisposition"
+enum UIDisplayDisposition {
+  AUTOMATIC_WITH_PASSWORD_PENDING = 0,
+  MANUAL_WITH_PASSWORD_PENDING,
+  MANUAL_MANAGE_PASSWORDS,
+  MANUAL_BLACKLISTED,
+  AUTOMATIC_GENERATED_PASSWORD_CONFIRMATION,
+  NUM_DISPLAY_DISPOSITIONS
+};
+
+// Metrics: "PasswordManager.UIDismissalReason"
+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,
+  CLICKED_UNBLACKLIST,
+  CLICKED_OK,
+  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
@@ -41,6 +82,23 @@ 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);
 
-}  // namespace password_manager_metrics_util
+// 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);
+
+// Log the appropriate display disposition.
+void LogUIDisplayDisposition(UIDisplayDisposition disposition);
+
+}  // namespace metrics_util
+
+}  // namespace password_manager
 
 #endif  // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_METRICS_UTIL_H_