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 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 SWITCH_PROFILE_ICON, // User switches profiles from icon menu | 60 SWITCH_PROFILE_ICON, // User switches profiles from icon menu |
61 SWITCH_PROFILE_MENU, // User switches profiles from menu bar | 61 SWITCH_PROFILE_MENU, // User switches profiles from menu bar |
62 SWITCH_PROFILE_DOCK, // User switches profiles from dock (Mac-only) | 62 SWITCH_PROFILE_DOCK, // User switches profiles from dock (Mac-only) |
63 OPEN_USER_MANAGER, // User opens the User Manager | 63 OPEN_USER_MANAGER, // User opens the User Manager |
64 SWITCH_PROFILE_MANAGER, // User switches profiles from the User Manager | 64 SWITCH_PROFILE_MANAGER, // User switches profiles from the User Manager |
65 SWITCH_PROFILE_UNLOCK, // User switches to lockd profile via User Manager | 65 SWITCH_PROFILE_UNLOCK, // User switches to lockd profile via User Manager |
66 SWITCH_PROFILE_GUEST, // User switches to guest profile | 66 SWITCH_PROFILE_GUEST, // User switches to guest profile |
67 NUM_PROFILE_OPEN_METRICS | 67 NUM_PROFILE_OPEN_METRICS |
68 }; | 68 }; |
69 | 69 |
70 // Enum for tracking the state of profiles being switched to. | |
71 enum ProfileOpenState { | |
72 // Profile being switched to is already opened and has browsers opened. | |
73 PROFILE_OPENED = 0, | |
74 // Profile being switched to is already opened but has no browsers opened. | |
75 PROFILE_OPENED_NO_BROWSER, | |
76 // Profile being switched to is not opened. | |
77 PROFILE_UNOPENED | |
78 }; | |
79 | |
70 // Enum for getting net counts for adding and deleting users. | 80 // Enum for getting net counts for adding and deleting users. |
71 enum ProfileNetUserCounts { | 81 enum ProfileNetUserCounts { |
72 ADD_NEW_USER = 0, // Total count of add new user | 82 ADD_NEW_USER = 0, // Total count of add new user |
73 PROFILE_DELETED, // User deleted a profile | 83 PROFILE_DELETED, // User deleted a profile |
74 NUM_PROFILE_NET_METRICS | 84 NUM_PROFILE_NET_METRICS |
75 }; | 85 }; |
76 | 86 |
77 // Sign in is logged once the user has entered their GAIA information. | 87 // Sign in is logged once the user has entered their GAIA information. |
78 // The options for sync are logged after the user has submitted the options | 88 // The options for sync are logged after the user has submitted the options |
79 // form. See sync_setup_handler.h. | 89 // form. See sync_setup_handler.h. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 // User selects 'Not You?' in the upgrade bubble. | 209 // User selects 'Not You?' in the upgrade bubble. |
200 PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU, | 210 PROFILE_AVATAR_MENU_UPGRADE_NOT_YOU, |
201 NUM_PROFILE_AVATAR_MENU_UPGRADE_METRICS, | 211 NUM_PROFILE_AVATAR_MENU_UPGRADE_METRICS, |
202 }; | 212 }; |
203 | 213 |
204 static void UpdateReportedProfilesStatistics(ProfileManager* manager); | 214 static void UpdateReportedProfilesStatistics(ProfileManager* manager); |
205 // Count and return summary information about the profiles currently in the | 215 // Count and return summary information about the profiles currently in the |
206 // |manager|. This information is returned in the output variable |counts|. | 216 // |manager|. This information is returned in the output variable |counts|. |
207 static bool CountProfileInformation(ProfileManager* manager, | 217 static bool CountProfileInformation(ProfileManager* manager, |
208 ProfileCounts* counts); | 218 ProfileCounts* counts); |
219 static ProfileOpenState GetProfileOpenState(ProfileManager* manager, | |
Mike Lerman
2015/01/23 19:46:14
GetProfileOpenState isn't called outside of profil
anthonyvd
2015/01/26 16:07:48
Done.
| |
220 const base::FilePath& path); | |
209 | 221 |
222 static void LogNumberOfProfileSwitches(); | |
210 static void LogNumberOfProfiles(ProfileManager* manager); | 223 static void LogNumberOfProfiles(ProfileManager* manager); |
211 static void LogProfileAddNewUser(ProfileAdd metric); | 224 static void LogProfileAddNewUser(ProfileAdd metric); |
212 static void LogProfileAvatarSelection(size_t icon_index); | 225 static void LogProfileAvatarSelection(size_t icon_index); |
213 static void LogProfileDeleteUser(ProfileDelete metric); | 226 static void LogProfileDeleteUser(ProfileDelete metric); |
214 static void LogProfileOpenMethod(ProfileOpen metric); | 227 static void LogProfileOpenMethod(ProfileOpen metric); |
228 static void LogProfileSwitch(ProfileOpen metric, | |
229 ProfileManager* manager, | |
230 const base::FilePath& profile_path); | |
215 static void LogProfileSwitchGaia(ProfileGaia metric); | 231 static void LogProfileSwitchGaia(ProfileGaia metric); |
216 static void LogProfileSwitchUser(ProfileOpen metric); | |
217 static void LogProfileSyncInfo(ProfileSync metric); | 232 static void LogProfileSyncInfo(ProfileSync metric); |
218 static void LogProfileAuthResult(ProfileAuth metric); | 233 static void LogProfileAuthResult(ProfileAuth metric); |
219 static void LogProfileDesktopMenu(ProfileDesktopMenu metric, | 234 static void LogProfileDesktopMenu(ProfileDesktopMenu metric, |
220 signin::GAIAServiceType gaia_service); | 235 signin::GAIAServiceType gaia_service); |
221 static void LogProfileDelete(bool profile_was_signed_in); | 236 static void LogProfileDelete(bool profile_was_signed_in); |
222 static void LogProfileNewAvatarMenuNotYou(ProfileNewAvatarMenuNotYou metric); | 237 static void LogProfileNewAvatarMenuNotYou(ProfileNewAvatarMenuNotYou metric); |
223 static void LogProfileNewAvatarMenuSignin(ProfileNewAvatarMenuSignin metric); | 238 static void LogProfileNewAvatarMenuSignin(ProfileNewAvatarMenuSignin metric); |
224 static void LogProfileNewAvatarMenuUpgrade( | 239 static void LogProfileNewAvatarMenuUpgrade( |
225 ProfileNewAvatarMenuUpgrade metric); | 240 ProfileNewAvatarMenuUpgrade metric); |
226 | 241 |
227 #if defined(OS_ANDROID) | 242 #if defined(OS_ANDROID) |
228 static void LogProfileAndroidAccountManagementMenu( | 243 static void LogProfileAndroidAccountManagementMenu( |
229 ProfileAndroidAccountManagementMenu metric, | 244 ProfileAndroidAccountManagementMenu metric, |
230 signin::GAIAServiceType gaia_service); | 245 signin::GAIAServiceType gaia_service); |
231 #endif // defined(OS_ANDROID) | 246 #endif // defined(OS_ANDROID) |
232 | 247 |
233 // These functions should only be called on the UI thread because they hook | 248 // These functions should only be called on the UI thread because they hook |
234 // into g_browser_process through a helper function. | 249 // into g_browser_process through a helper function. |
235 static void LogProfileLaunch(Profile* profile); | 250 static void LogProfileLaunch(Profile* profile); |
236 static void LogProfileSyncSignIn(const base::FilePath& profile_path); | 251 static void LogProfileSyncSignIn(const base::FilePath& profile_path); |
237 static void LogProfileUpdate(const base::FilePath& profile_path); | 252 static void LogProfileUpdate(const base::FilePath& profile_path); |
238 }; | 253 }; |
239 | 254 |
240 | 255 |
241 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ | 256 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ |
OLD | NEW |