1 // Copyright 2020 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 5 #ifndef ASH_PUBLIC_CPP_HOLDING_SPACE_HOLDING_SPACE_METRICS_H_ 6 #define ASH_PUBLIC_CPP_HOLDING_SPACE_HOLDING_SPACE_METRICS_H_ 7 8 #include <vector> 9 10 #include "ash/public/cpp/ash_public_export.h" 11 12 namespace base { 13 class TimeDelta; 14 } // namespace base 15 16 namespace ash { 17 18 class HoldingSpaceItem; 19 20 namespace holding_space_metrics { 21 22 // Enumeration of actions that can be taken on the holding space pod in the 23 // shelf. Note that these values are persisted to histograms so existing values 24 // should remain unchanged and new values should be added to the end. 25 enum class PodAction { 26 // kClick (Deprecated) = 0, 27 kShow = 1, 28 kClose = 2, 29 kShowContextMenu = 3, 30 kShowPreviews = 4, 31 kHidePreviews = 5, 32 kMaxValue = kHidePreviews, 33 }; 34 35 // Records the specified `action` taken on the holding space pod in the shelf. 36 ASH_PUBLIC_EXPORT void RecordPodAction(PodAction action); 37 38 // Enumeration of actions that can be taken on the holding space downloads 39 // button. Note that these values are persisted to histograms so existing 40 // values should remain unchanged and new values should be added to the end. 41 enum class DownloadsAction { 42 kClick = 0, 43 kMaxValue = kClick, 44 }; 45 46 // Records the specified `action` taken on the holding space downloads header. 47 ASH_PUBLIC_EXPORT void RecordDownloadsAction(DownloadsAction action); 48 49 // Enumeration of actions that can be taken on holding space items. Note that 50 // these values are persisted to histograms so existing values should remain 51 // unchanged and new values should be added to the end. 52 enum class ItemAction { 53 kCopy = 0, 54 kDrag = 1, 55 kLaunch = 2, 56 kPin = 3, 57 kShowInFolder = 4, 58 kUnpin = 5, 59 kMaxValue = kUnpin, 60 }; 61 62 // Records the specified `action` taken on a set of holding space `items`. 63 ASH_PUBLIC_EXPORT void RecordItemAction( 64 const std::vector<const HoldingSpaceItem*>& items, 65 ItemAction action); 66 67 // Records counts for the specified holding space `items`. 68 ASH_PUBLIC_EXPORT void RecordItemCounts( 69 const std::vector<const HoldingSpaceItem*>& items); 70 71 // Records time from the first availability of the holding space feature to the 72 // first item being added to holding space. 73 ASH_PUBLIC_EXPORT void RecordTimeFromFirstAvailabilityToFirstAdd( 74 base::TimeDelta time_delta); 75 76 // Records time from first availability to the first entry into holding space. 77 ASH_PUBLIC_EXPORT void RecordTimeFromFirstAvailabilityToFirstEntry( 78 base::TimeDelta time_delta); 79 80 // Records time from first entry to the first pin into holding space. 81 ASH_PUBLIC_EXPORT void RecordTimeFromFirstEntryToFirstPin( 82 base::TimeDelta time_delta); 83 84 } // namespace holding_space_metrics 85 } // namespace ash 86 87 #endif // ASH_PUBLIC_CPP_HOLDING_SPACE_HOLDING_SPACE_METRICS_H_ 88