Steven Luong | ce5488f3 | 2024-09-30 18:11:23 | [diff] [blame] | 1 | // Copyright 2024 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_UI_TOASTS_TOAST_METRICS_H_ |
| 6 | #define CHROME_BROWSER_UI_TOASTS_TOAST_METRICS_H_ |
| 7 | |
| 8 | enum class ToastId; |
| 9 | |
| 10 | namespace toasts { |
| 11 | enum class ToastCloseReason; |
Alison Gale | 032ff36 | 2024-12-13 20:22:01 | [diff] [blame^] | 12 | |
| 13 | // These values are persisted to logs. Entries should not be renumbered and |
| 14 | // numeric values should never be reused. |
| 15 | enum class ToastAlertLevel { |
| 16 | kAll = 0, |
| 17 | kActionable = 1, |
| 18 | kMaxValue = kActionable |
| 19 | }; |
| 20 | |
| 21 | // LINT.IfChange(ToastDismissMenuEntries) |
| 22 | // These values are persisted to logs. Entries should not be renumbered and |
| 23 | // numeric values should never be reused. |
| 24 | enum class ToastDismissMenuEntries { |
| 25 | kDismiss = 0, |
| 26 | kDontShowAgain = 1, |
| 27 | kMaxValue = kDontShowAgain |
| 28 | }; |
| 29 | // LINT.ThenChange(/tools/metrics/histograms/metadata/toasts/enums.xml:ToastDismissMenuEntries) |
| 30 | } // namespace toasts |
Steven Luong | ce5488f3 | 2024-09-30 18:11:23 | [diff] [blame] | 31 | |
| 32 | void RecordToastTriggeredToShow(ToastId toast_id); |
| 33 | |
Alison Gale | 032ff36 | 2024-12-13 20:22:01 | [diff] [blame^] | 34 | void RecordToastFailedToShow(ToastId toast_id); |
| 35 | |
Steven Luong | ce5488f3 | 2024-09-30 18:11:23 | [diff] [blame] | 36 | void RecordToastActionButtonClicked(ToastId toast_id); |
| 37 | |
| 38 | void RecordToastCloseButtonClicked(ToastId toast_id); |
| 39 | |
| 40 | void RecordToastDismissReason(ToastId toast_id, |
| 41 | toasts::ToastCloseReason close_reason); |
| 42 | |
Alison Gale | 032ff36 | 2024-12-13 20:22:01 | [diff] [blame^] | 43 | void RecordToastDismissMenuClicked(ToastId toast_id, |
| 44 | toasts::ToastDismissMenuEntries command_id); |
| 45 | |
Steven Luong | ce5488f3 | 2024-09-30 18:11:23 | [diff] [blame] | 46 | #endif // CHROME_BROWSER_UI_TOASTS_TOAST_METRICS_H_ |