projector_metrics.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PROJECTOR_PROJECTOR_METRICS_H_
  5. #define ASH_PROJECTOR_PROJECTOR_METRICS_H_
  6. #include <cstddef>
  7. namespace base {
  8. class TimeDelta;
  9. } // namespace base
  10. namespace ash {
  11. // These enum values represent buttons on the Projector toolbar and log to UMA.
  12. // Entries should not be renumbered and numeric values should never be reused.
  13. // When removing an unused enumerator, comment it out, making it clear the value
  14. // was previously used.
  15. // Please keep in sync with "ProjectorToolbar" in
  16. // src/tools/metrics/histograms/enums.xml.
  17. enum class ProjectorToolbar {
  18. // kToolbarOpened = 0,
  19. // kToolbarClosed = 1,
  20. // kKeyIdea = 2,
  21. // kLaserPointer = 3,
  22. kMarkerTool = 4,
  23. // kExpandMarkerTools = 5,
  24. // kCollapseMarkerTools = 6,
  25. // kClearAllMarkers = 7,
  26. // kStartMagnifier = 8,
  27. // kStopMagnifier = 9,
  28. // kStartSelfieCamera = 10,
  29. // kStopSelfieCamera = 11,
  30. // kStartClosedCaptions = 12,
  31. // kStopClosedCaptions = 13,
  32. // kToolbarLocationBottomLeft = 14,
  33. // kToolbarLocationTopLeft = 15,
  34. // kToolbarLocationTopRight = 16,
  35. // kToolbarLocationBottomRight = 17,
  36. // kUndo = 18,
  37. // kToolbarLocationTopCenter = 19,
  38. // kToolbarLocationBottomCenter = 20,
  39. // Add future entries above this comment, in sync with
  40. // "ProjectorToolbar" in src/tools/metrics/histograms/enums.xml.
  41. // Update kMaxValue to the last value.
  42. kMaxValue = kMarkerTool
  43. };
  44. // These enum values represent marker colors on the Projector toolbar and log to
  45. // UMA. Entries should not be renumbered and numeric values should never be
  46. // reused. Please keep in sync with "ProjectorMarkerColor" in
  47. // src/tools/metrics/histograms/enums.xml.
  48. enum class ProjectorMarkerColor {
  49. // kBlack = 0,
  50. // kWhite = 1,
  51. kBlue = 2,
  52. kRed = 3,
  53. kYellow = 4,
  54. kMagenta = 5,
  55. // Add future entries above this comment, in sync with
  56. // "ProjectorMarkerColor" in src/tools/metrics/histograms/enums.xml.
  57. // Update kMaxValue to the last value.
  58. kMaxValue = kMagenta
  59. };
  60. // These enum values represent steps in the Projector creation flow and log to
  61. // UMA. Entries should not be renumbered and numeric values should never be
  62. // reused. Please keep in sync with "ProjectorCreationFlow" in
  63. // src/tools/metrics/histograms/enums.xml.
  64. enum class ProjectorCreationFlow {
  65. kSessionStarted = 0,
  66. kRecordingStarted = 1,
  67. kRecordingAborted = 2,
  68. kRecordingEnded = 3,
  69. kSessionStopped = 4,
  70. // Add future entries above this comment, in sync with
  71. // "ProjectorCreationFlow" in src/tools/metrics/histograms/enums.xml.
  72. // Update kMaxValue to the last value.
  73. kMaxValue = kSessionStopped
  74. };
  75. // These enum values represent user-facing errors in the Projector creation flow
  76. // and log to UMA. Entries should not be renumbered and numeric values should
  77. // never be reused. Please keep in sync with "ProjectorCreationFlowError" in
  78. // src/tools/metrics/histograms/enums.xml.
  79. enum class ProjectorCreationFlowError {
  80. kSaveError = 0,
  81. kTranscriptionError = 1,
  82. // Add future entries above this comment, in sync with
  83. // "ProjectorCreationFlowError" in src/tools/metrics/histograms/enums.xml.
  84. // Update kMaxValue to the last value.
  85. kMaxValue = kTranscriptionError
  86. };
  87. // These enum values represent potential error that occurs at policy value
  88. // change handling and log to UMA. Entries should not be renumbered and numeric
  89. // values should never be reused. Please keep in sync with
  90. // "ProjectorPolicyChangeHandlingError" in
  91. // src/tools/metrics/histograms/enums.xml.
  92. enum class ProjectorPolicyChangeHandlingError {
  93. kSwaManager = 0,
  94. kWebAppProvider = 1,
  95. kWebAppProviderOnRegistryReady = 2,
  96. kSyncBridge = 3,
  97. kMaxValue = kSyncBridge
  98. };
  99. // Records the buttons the user presses on the Projector toolbar.
  100. void RecordToolbarMetrics(ProjectorToolbar button);
  101. // Records the marker colors the user chooses to use. Only records if the user
  102. // switches from the default color.
  103. void RecordMarkerColorMetrics(ProjectorMarkerColor color);
  104. // Records the user's progress in the Projector creation flow.
  105. void RecordCreationFlowMetrics(ProjectorCreationFlow step);
  106. // Records the number of transcripts generated during a screencast recording.
  107. void RecordTranscriptsCount(size_t count);
  108. // Records errors encountered during the creation flow.
  109. void RecordCreationFlowError(int message_id);
  110. // Records the IO task processing Time for screencast validation.
  111. void RecordPendingScreencastBatchIOTaskDuration(const base::TimeDelta duration);
  112. // Records the interval between the UI changes of pending screencasts.
  113. void RecordPendingScreencastChangeInterval(const base::TimeDelta interval);
  114. // Records potential error occurs at policy change.
  115. // TODO(b/240497023): remove this once confirmed the nullptr should never
  116. // occurs and the nullptr check is converted to DCEHCK.
  117. void RecordPolicyChangeHandlingError(ProjectorPolicyChangeHandlingError error);
  118. } // namespace ash
  119. #endif // ASH_PROJECTOR_PROJECTOR_METRICS_H_