1 // Copyright (c) 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_SYSTEM_PHONEHUB_PHONE_HUB_METRICS_H_
6 #define ASH_SYSTEM_PHONEHUB_PHONE_HUB_METRICS_H_
7 
8 namespace ash {
9 namespace phone_hub_metrics {
10 
11 // Keep in sync with corresponding enum in tools/metrics/histograms/enums.xml.
12 enum class InterstitialScreenEvent {
13   kShown = 0,
14   kLearnMore = 1,
15   kDismiss = 2,
16   kConfirm = 3,
17   kMaxValue = kConfirm
18 };
19 
20 // Keep in sync with corresponding enum in tools/metrics/histograms/enums.xml.
21 enum class Screen {
22   kBluetoothOrWifiDisabled = 0,
23   kConnectionError = 1,
24   kInitialConnecting = 2,
25   kReconnecting = 3,
26   kOnboardingExistingMultideviceUser = 4,
27   kOnboardingNewMultideviceUser = 5,
28   kPhoneConnected = 6,
29   kOnboardingDismissPrompt = 7,
30   kInvalid = 8,
31   kMaxValue = kInvalid
32 };
33 
34 // Keep in sync with corresponding enum in tools/metrics/histograms/enums.xml.
35 enum class QuickAction {
36   kToggleHotspotOn = 0,
37   kToggleHotspotOff,
38   kToggleQuietModeOn,
39   kToggleQuietModeOff,
40   kToggleLocatePhoneOn,
41   kToggleLocatePhoneOff,
42   kMaxValue = kToggleLocatePhoneOff
43 };
44 
45 // Enumeration of possible interactions with a PhoneHub notification. Keep in
46 // sync with corresponding enum in tools/metrics/histograms/enums.xml. These
47 // values are persisted to logs. Entries should not be renumbered and numeric
48 // values should never be reused.
49 enum class NotificationInteraction {
50   kInlineReply = 0,
51   kDismiss = 1,
52   kMaxValue = kDismiss,
53 };
54 
55 // Logs an |event| occurring for the given |interstitial_screen|.
56 void LogInterstitialScreenEvent(Screen screen, InterstitialScreenEvent event);
57 
58 // Logs the |screen| when the PhoneHub bubble opens.
59 void LogScreenOnBubbleOpen(Screen screen);
60 
61 // Logs the |screen| when the PhoneHub bubble closes.
62 void LogScreenOnBubbleClose(Screen screen);
63 
64 // Logs the |screen| when the settings button is clicked.
65 void LogScreenOnSettingsButtonClicked(Screen screen);
66 
67 // Logs an |event| for the notification opt-in prompt.
68 void LogNotificationOptInEvent(InterstitialScreenEvent event);
69 
70 // Logs the |tab_index| of the tab continuation chip that was clicked.
71 void LogTabContinuationChipClicked(int tab_index);
72 
73 // Logs a given |quick_action| click.
74 void LogQuickActionClick(QuickAction quick_action);
75 
76 // Logs the number of PhoneHub notifications after one is added or removed.
77 void LogNotificationCount(int count);
78 
79 // Logs a given |interaction| with a PhoneHub notification.
80 void LogNotificationInteraction(NotificationInteraction interaction);
81 
82 }  // namespace phone_hub_metrics
83 }  // namespace ash
84 
85 #endif  // ASH_SYSTEM_PHONEHUB_PHONE_HUB_METRICS_H_
86