| 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 namespace signin { |
| 21 enum GAIA_SERVICE_TYPE; |
| 22 } |
| 23 |
| 20 class ProfileMetrics { | 24 class ProfileMetrics { |
| 21 public: | 25 public: |
| 22 // Enum for counting the ways users were added. | 26 // Enum for counting the ways users were added. |
| 23 enum ProfileAdd { | 27 enum ProfileAdd { |
| 24 ADD_NEW_USER_ICON = 0, // User adds new user from icon menu | 28 ADD_NEW_USER_ICON = 0, // User adds new user from icon menu |
| 25 ADD_NEW_USER_MENU, // User adds new user from menu bar | 29 ADD_NEW_USER_MENU, // User adds new user from menu bar |
| 26 ADD_NEW_USER_DIALOG, // User adds new user from create-profile dialog | 30 ADD_NEW_USER_DIALOG, // User adds new user from create-profile dialog |
| 27 ADD_NEW_USER_MANAGER, // User adds new user from User Manager | 31 ADD_NEW_USER_MANAGER, // User adds new user from User Manager |
| 28 NUM_PROFILE_ADD_METRICS | 32 NUM_PROFILE_ADD_METRICS |
| 29 }; | 33 }; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 PROFILE_ENROLLMENT_ACCEPT_NEW_PROFILE_MGMT, | 95 PROFILE_ENROLLMENT_ACCEPT_NEW_PROFILE_MGMT, |
| 92 // User closed the Upgrade card. | 96 // User closed the Upgrade card. |
| 93 PROFILE_ENROLLMENT_CLOSE_WELCOME_CARD, | 97 PROFILE_ENROLLMENT_CLOSE_WELCOME_CARD, |
| 94 // User disabled New Profile Management. | 98 // User disabled New Profile Management. |
| 95 PROFILE_ENROLLMENT_DISABLE_NEW_PROFILE_MGMT, | 99 PROFILE_ENROLLMENT_DISABLE_NEW_PROFILE_MGMT, |
| 96 // User elected to send feedback. | 100 // User elected to send feedback. |
| 97 PROFILE_ENROLLMENT_SEND_FEEDBACK, | 101 PROFILE_ENROLLMENT_SEND_FEEDBACK, |
| 98 NUM_PROFILE_ENROLLMENT_METRICS, | 102 NUM_PROFILE_ENROLLMENT_METRICS, |
| 99 }; | 103 }; |
| 100 | 104 |
| 105 // Enum for tracking user interactions with the user menu and user manager. |
| 106 // Interactions initiated from the content area are logged into a different |
| 107 // histogram from those that were initiated from the avatar button. |
| 108 // An example of the interaction beginning in the content area is |
| 109 // clicking "Manage Accounts" within account selection on a Google property. |
| 110 enum ProfileDesktopMenu { |
| 111 // User opened the user menu, and clicked lock. |
| 112 PROFILE_DESKTOP_MENU_LOCK = 0, |
| 113 // User opened the user menu, and removed an account. |
| 114 PROFILE_DESKTOP_MENU_REMOVE_ACCT, |
| 115 // User opened the user menu, and started adding an account. |
| 116 PROFILE_DESKTOP_MENU_ADD_ACCT, |
| 117 NUM_PROFILE_DESKTOP_MENU_METRICS, |
| 118 }; |
| 119 |
| 101 static void UpdateReportedProfilesStatistics(ProfileManager* manager); | 120 static void UpdateReportedProfilesStatistics(ProfileManager* manager); |
| 102 | 121 |
| 103 static void LogNumberOfProfiles(ProfileManager* manager); | 122 static void LogNumberOfProfiles(ProfileManager* manager); |
| 104 static void LogProfileAddNewUser(ProfileAdd metric); | 123 static void LogProfileAddNewUser(ProfileAdd metric); |
| 105 static void LogProfileAvatarSelection(size_t icon_index); | 124 static void LogProfileAvatarSelection(size_t icon_index); |
| 106 static void LogProfileDeleteUser(ProfileNetUserCounts metric); | 125 static void LogProfileDeleteUser(ProfileNetUserCounts metric); |
| 107 static void LogProfileOpenMethod(ProfileOpen metric); | 126 static void LogProfileOpenMethod(ProfileOpen metric); |
| 108 static void LogProfileSwitchGaia(ProfileGaia metric); | 127 static void LogProfileSwitchGaia(ProfileGaia metric); |
| 109 static void LogProfileSwitchUser(ProfileOpen metric); | 128 static void LogProfileSwitchUser(ProfileOpen metric); |
| 110 static void LogProfileSyncInfo(ProfileSync metric); | 129 static void LogProfileSyncInfo(ProfileSync metric); |
| 111 static void LogProfileAuthResult(ProfileAuth metric); | 130 static void LogProfileAuthResult(ProfileAuth metric); |
| 112 static void LogProfileUpgradeEnrollment(ProfileUpgradeEnrollment metric); | 131 static void LogProfileUpgradeEnrollment(ProfileUpgradeEnrollment metric); |
| 132 static void LogProfileDesktopMenu(ProfileDesktopMenu metric, |
| 133 signin::GAIA_SERVICE_TYPE gaia_service); |
| 113 | 134 |
| 114 // These functions should only be called on the UI thread because they hook | 135 // These functions should only be called on the UI thread because they hook |
| 115 // into g_browser_process through a helper function. | 136 // into g_browser_process through a helper function. |
| 116 static void LogProfileLaunch(Profile* profile); | 137 static void LogProfileLaunch(Profile* profile); |
| 117 static void LogProfileSyncSignIn(const base::FilePath& profile_path); | 138 static void LogProfileSyncSignIn(const base::FilePath& profile_path); |
| 118 static void LogProfileUpdate(const base::FilePath& profile_path); | 139 static void LogProfileUpdate(const base::FilePath& profile_path); |
| 119 }; | 140 }; |
| 120 | 141 |
| 121 | 142 |
| 122 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ | 143 #endif // CHROME_BROWSER_PROFILES_PROFILE_METRICS_H_ |
| OLD | NEW |