shelf_metrics.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright 2019 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_SHELF_SHELF_METRICS_H_
  5. #define ASH_SHELF_SHELF_METRICS_H_
  6. namespace ash {
  7. // The name of the histogram which records the usage of gestures on the in-app
  8. // hotseat.
  9. constexpr char kHotseatGestureHistogramName[] = "Ash.HotseatGesture";
  10. // The name of the histogram which records the usage of gestures to enter
  11. // overview mode from home screen.
  12. constexpr char kEnterOverviewHistogramName[] = "Ash.SwipeHomeToOverviewGesture";
  13. // The name of the histogram which records the result of handling the drag on
  14. // window from shelf.
  15. constexpr char kHandleDragWindowFromShelfHistogramName[] =
  16. "Ash.WindowDragFromShelfResult";
  17. // Types of gestures supported by the in-app hotseat. These values are persisted
  18. // to logs. Entries should not be renumbered and numeric values should never be
  19. // reused.
  20. enum class InAppShelfGestures {
  21. // Swipe up to show the hotseat.
  22. kSwipeUpToShow = 0,
  23. // Swipe down to hide the hotseat.
  24. kSwipeDownToHide = 1,
  25. // Fling up to show the home screen.
  26. kFlingUpToShowHomeScreen = 2,
  27. // Hotseat hidden due to interacting outside of the shelf/hotseat.
  28. kHotseatHiddenDueToInteractionOutsideOfShelf = 3,
  29. // New items should be added before to keep this one always the last.
  30. kMaxInAppShelfGestures = 4,
  31. kMaxValue = kMaxInAppShelfGestures
  32. };
  33. // States of entering overview mode from home launcher. These values are
  34. // persisted to logs. Entries should not be renumbered and numeric values should
  35. // never be reused.
  36. enum class EnterOverviewFromHomeLauncher {
  37. // Cancel the action to enter overview mode from home launcher.
  38. kCanceled = 0,
  39. // Succeed to enter overview mode from home launcher.
  40. kOverview = 1,
  41. // The gesture was detected as a swipe to the home screen initial state.
  42. kBack = 2,
  43. // New items should be added before to keep this one always the last.
  44. kMaxState = 3,
  45. kMaxValue = kMaxState
  46. };
  47. // Results of handling the drag on window from shelf. These values are
  48. // persisted to logs. Entries should not be renumbered and numeric values should
  49. // never be reused.
  50. enum class ShelfWindowDragResult {
  51. // Goes to home screen after drag.
  52. kGoToHomeScreen = 0,
  53. // Dragged window restored to its original bounds after drag.
  54. kRestoreToOriginalBounds = 1,
  55. // Dragged window is dropped to overview after drag.
  56. kGoToOverviewMode = 2,
  57. // Enter splitview mode after drag.
  58. kGoToSplitviewMode = 3,
  59. // Drag is canceled instead of ending normally.
  60. kDragCanceled = 4,
  61. kMaxValue = kDragCanceled
  62. };
  63. } // namespace ash
  64. #endif // ASH_SHELF_SHELF_METRICS_H_