OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "chrome/browser/signin/signin_header_helper.h" |
12 | 13 |
13 class Profile; | 14 class Profile; |
14 class ProfileManager; | 15 class ProfileManager; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class FilePath; | 18 class FilePath; |
18 } | 19 } |
19 | 20 |
20 class ProfileMetrics { | 21 class ProfileMetrics { |
21 public: | 22 public: |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 PROFILE_ENROLLMENT_ACCEPT_NEW_PROFILE_MGMT, | 92 PROFILE_ENROLLMENT_ACCEPT_NEW_PROFILE_MGMT, |
92 // User closed the Upgrade card. | 93 // User closed the Upgrade card. |
93 PROFILE_ENROLLMENT_CLOSE_WELCOME_CARD, | 94 PROFILE_ENROLLMENT_CLOSE_WELCOME_CARD, |
94 // User disabled New Profile Management. | 95 // User disabled New Profile Management. |
95 PROFILE_ENROLLMENT_DISABLE_NEW_PROFILE_MGMT, | 96 PROFILE_ENROLLMENT_DISABLE_NEW_PROFILE_MGMT, |
96 // User elected to send feedback. | 97 // User elected to send feedback. |
97 PROFILE_ENROLLMENT_SEND_FEEDBACK, | 98 PROFILE_ENROLLMENT_SEND_FEEDBACK, |
98 NUM_PROFILE_ENROLLMENT_METRICS, | 99 NUM_PROFILE_ENROLLMENT_METRICS, |
99 }; | 100 }; |
100 | 101 |
| 102 // Enum for tracking user interactions with the user menu and user manager. |
| 103 // Interactions initiated from the content area are logged into a different |
| 104 // histogram from those that were initiated from the avatar button. |
| 105 // An example of the interaction beginning in the content area is |
| 106 // clicking "Manage Accounts" within account selection on a Google property. |
| 107 enum ProfileDesktopMenu { |
| 108 // User opened the user menu, and clicked lock. |
| 109 PROFILE_DESKTOP_MENU_LOCK = 0, |
| 110 // User opened the user menu, and removed an account. |
| 111 PROFILE_DESKTOP_MENU_REMOVE_ACCT, |
| 112 // User opened the user menu, and started adding an account. |
| 113 PROFILE_DESKTOP_MENU_ADD_ACCT, |
| 114 NUM_PROFILE_DESKTOP_MENU_METRICS, |
| 115 }; |
| 116 |
101 static void UpdateReportedProfilesStatistics(ProfileManager* manager); | 117 static void UpdateReportedProfilesStatistics(ProfileManager* manager); |
102 | 118 |
103 static void LogNumberOfProfiles(ProfileManager* manager); | 119 static void LogNumberOfProfiles(ProfileManager* manager); |
104 static void LogProfileAddNewUser(ProfileAdd metric); | 120 static void LogProfileAddNewUser(ProfileAdd metric); |
105 static void LogProfileAvatarSelection(size_t icon_index); | 121 static void LogProfileAvatarSelection(size_t icon_index); |
106 static void LogProfileDeleteUser(ProfileNetUserCounts metric); | 122 static void LogProfileDeleteUser(ProfileNetUserCounts metric); |
107 static void LogProfileOpenMethod(ProfileOpen metric); | 123 static void LogProfileOpenMethod(ProfileOpen metric); |
108 static void LogProfileSwitchGaia(ProfileGaia metric); | 124 static void LogProfileSwitchGaia(ProfileGaia metric); |
109 static void LogProfileSwitchUser(ProfileOpen metric); | 125 static void LogProfileSwitchUser(ProfileOpen metric); |
110 static void LogProfileSyncInfo(ProfileSync metric); | 126 static void LogProfileSyncInfo(ProfileSync metric); |
111 static void LogProfileAuthResult(ProfileAuth metric); | 127 static void LogProfileAuthResult(ProfileAuth metric); |
112 static void LogProfileUpgradeEnrollment(ProfileUpgradeEnrollment metric); | 128 static void LogProfileUpgradeEnrollment(ProfileUpgradeEnrollment metric); |
| 129 static void LogProfileDesktopMenu(ProfileDesktopMenu metric, |
| 130 signin::GAIAServiceType gaia_service); |
113 | 131 |
114 // These functions should only be called on the UI thread because they hook | 132 // These functions should only be called on the UI thread because they hook |
115 // into g_browser_process through a helper function. | 133 // into g_browser_process through a helper function. |
116 static void LogProfileLaunch(Profile* profile); | 134 static void LogProfileLaunch(Profile* profile); |
117 static void LogProfileSyncSignIn(const base::FilePath& profile_path); | 135 static void LogProfileSyncSignIn(const base::FilePath& profile_path); |
118 static void LogProfileUpdate(const base::FilePath& profile_path); | 136 static void LogProfileUpdate(const base::FilePath& profile_path); |
119 }; | 137 }; |
120 | 138 |
121 | 139 |
122 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ | 140 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ |
OLD | NEW |