Chromium Code Reviews| 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 | 12 |
| 13 class Profile; | 13 class Profile; |
| 14 class ProfileManager; | 14 class ProfileManager; |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class FilePath; | 17 class FilePath; |
| 18 } | 18 } |
| 19 | 19 |
| 20 class ProfileMetrics { | 20 class ProfileMetrics { |
| 21 public: | 21 public: |
| 22 // Enum for counting the ways users were added. | 22 // Enum for counting the ways users were added. |
| 23 enum ProfileAdd { | 23 enum ProfileAdd { |
| 24 ADD_NEW_USER_ICON = 0, // User adds new user from icon menu | 24 ADD_NEW_USER_ICON = 0, // User adds new user from icon menu |
| 25 ADD_NEW_USER_MENU, // User adds new user from menu bar | 25 ADD_NEW_USER_MENU, // User adds new user from menu bar |
| 26 ADD_NEW_USER_DIALOG, // User adds new user from create-profile dialog | 26 ADD_NEW_USER_DIALOG, // User adds new user from create-profile dialog |
| 27 ADD_NEW_USER_MANAGER, // User adds new user from User Manager | |
| 27 NUM_PROFILE_ADD_METRICS | 28 NUM_PROFILE_ADD_METRICS |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 // Enum for counting the ways user profiles and menus were opened. | 31 // Enum for counting the ways user profiles and menus were opened. |
| 31 enum ProfileOpen { | 32 enum ProfileOpen { |
| 32 NTP_AVATAR_BUBBLE = 0, // User opens avatar icon menu from NTP | 33 NTP_AVATAR_BUBBLE = 0, // User opens avatar icon menu from NTP |
| 33 ICON_AVATAR_BUBBLE, // User opens avatar icon menu from icon | 34 ICON_AVATAR_BUBBLE, // User opens avatar icon menu from icon |
| 34 SWITCH_PROFILE_ICON, // User switches profiles from icon menu | 35 SWITCH_PROFILE_ICON, // User switches profiles from icon menu |
| 35 SWITCH_PROFILE_MENU, // User switches profiles from menu bar | 36 SWITCH_PROFILE_MENU, // User switches profiles from menu bar |
| 36 SWITCH_PROFILE_DOCK, // User switches profiles from dock (Mac-only) | 37 SWITCH_PROFILE_DOCK, // User switches profiles from dock (Mac-only) |
| 38 OPEN_USER_MANAGER, // User opens the User Manager | |
| 39 SWITCH_PROFILE_MANAGER, // User switches profiles from the User Manager | |
| 40 SWITCH_PROFILE_UNLOCK, // User switches to lockd profile via User Manager | |
|
msw
2014/01/29 21:08:48
nit: "locked"
| |
| 41 SWITCH_PROFILE_GUEST, // User switches to guest profile | |
| 37 NUM_PROFILE_OPEN_METRICS | 42 NUM_PROFILE_OPEN_METRICS |
| 38 }; | 43 }; |
| 39 | 44 |
| 40 // Enum for getting net counts for adding and deleting users. | 45 // Enum for getting net counts for adding and deleting users. |
| 41 enum ProfileNetUserCounts { | 46 enum ProfileNetUserCounts { |
| 42 ADD_NEW_USER = 0, // Total count of add new user | 47 ADD_NEW_USER = 0, // Total count of add new user |
| 43 PROFILE_DELETED, // User deleted a profile | 48 PROFILE_DELETED, // User deleted a profile |
| 44 NUM_PROFILE_NET_METRICS | 49 NUM_PROFILE_NET_METRICS |
| 45 }; | 50 }; |
| 46 | 51 |
| 47 // Sign in is logged once the user has entered their GAIA information. | 52 // Sign in is logged once the user has entered their GAIA information. |
| 48 // The options for sync are logged after the user has submitted the options | 53 // The options for sync are logged after the user has submitted the options |
| 49 // form. See sync_setup_handler.h. | 54 // form. See sync_setup_handler.h. |
| 50 enum ProfileSync { | 55 enum ProfileSync { |
| 51 SYNC_CUSTOMIZE = 0, // User decided to customize sync | 56 SYNC_CUSTOMIZE = 0, // User decided to customize sync |
| 52 SYNC_CHOOSE, // User chose what to sync | 57 SYNC_CHOOSE, // User chose what to sync |
| 53 SYNC_ENCRYPT, // User has chosen to encrypt all data | 58 SYNC_ENCRYPT, // User has chosen to encrypt all data |
| 54 SYNC_PASSPHRASE, // User is using a passphrase | 59 SYNC_PASSPHRASE, // User is using a passphrase |
| 55 NUM_PROFILE_SYNC_METRICS | 60 NUM_PROFILE_SYNC_METRICS |
| 56 }; | 61 }; |
| 57 | 62 |
| 58 enum ProfileType { | 63 enum ProfileType { |
| 59 ORIGINAL = 0, // Refers to the original/default profile | 64 ORIGINAL = 0, // Refers to the original/default profile |
| 60 SECONDARY, // Refers to a user-created profile | 65 SECONDARY, // Refers to a user-created profile |
| 61 NUM_PROFILE_TYPE_METRICS | 66 NUM_PROFILE_TYPE_METRICS |
| 62 }; | 67 }; |
| 63 | 68 |
| 64 enum ProfileGaia { | 69 enum ProfileGaia { |
| 65 GAIA_OPT_IN = 0, // User changed to GAIA photo as avatar | 70 GAIA_OPT_IN = 0, // User changed to GAIA photo as avatar |
| 66 GAIA_OPT_OUT, // User changed to not use GAIA photo as avatar | 71 GAIA_OPT_OUT, // User changed to not use GAIA photo as avatar |
| 67 NUM_PROFILE_GAIA_METRICS | 72 NUM_PROFILE_GAIA_METRICS |
| 68 }; | 73 }; |
| 69 | 74 |
| 75 enum ProfileAuth { | |
| 76 AUTH_UNNECESSARY, // Profile was not locked | |
| 77 AUTH_LOCAL, // Profile was authenticated locally | |
| 78 AUTH_ONLINE, // Profile was authenticated on-line | |
| 79 AUTH_FAILED, // Profile failed authentication | |
| 80 NUM_PROFILE_AUTH_METRICS | |
| 81 }; | |
| 82 | |
| 70 static void UpdateReportedProfilesStatistics(ProfileManager* manager); | 83 static void UpdateReportedProfilesStatistics(ProfileManager* manager); |
| 71 | 84 |
| 72 static void LogNumberOfProfiles(ProfileManager* manager); | 85 static void LogNumberOfProfiles(ProfileManager* manager); |
| 73 static void LogProfileAddNewUser(ProfileAdd metric); | 86 static void LogProfileAddNewUser(ProfileAdd metric); |
| 74 static void LogProfileAvatarSelection(size_t icon_index); | 87 static void LogProfileAvatarSelection(size_t icon_index); |
| 75 static void LogProfileDeleteUser(ProfileNetUserCounts metric); | 88 static void LogProfileDeleteUser(ProfileNetUserCounts metric); |
| 76 static void LogProfileOpenMethod(ProfileOpen metric); | 89 static void LogProfileOpenMethod(ProfileOpen metric); |
| 77 static void LogProfileSwitchGaia(ProfileGaia metric); | 90 static void LogProfileSwitchGaia(ProfileGaia metric); |
| 78 static void LogProfileSwitchUser(ProfileOpen metric); | 91 static void LogProfileSwitchUser(ProfileOpen metric); |
| 79 static void LogProfileSyncInfo(ProfileSync metric); | 92 static void LogProfileSyncInfo(ProfileSync metric); |
| 93 static void LogProfileAuthResult(ProfileAuth metric); | |
| 80 | 94 |
| 81 // These functions should only be called on the UI thread because they hook | 95 // These functions should only be called on the UI thread because they hook |
| 82 // into g_browser_process through a helper function. | 96 // into g_browser_process through a helper function. |
| 83 static void LogProfileLaunch(Profile* profile); | 97 static void LogProfileLaunch(Profile* profile); |
| 84 static void LogProfileSyncSignIn(const base::FilePath& profile_path); | 98 static void LogProfileSyncSignIn(const base::FilePath& profile_path); |
| 85 static void LogProfileUpdate(const base::FilePath& profile_path); | 99 static void LogProfileUpdate(const base::FilePath& profile_path); |
| 86 }; | 100 }; |
| 87 | 101 |
| 88 | 102 |
| 89 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ | 103 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ |
| OLD | NEW |