| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/profiles/profile_metrics.h" | 5 #include "chrome/browser/profiles/profile_metrics.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 AVATAR_PIZZA, | 100 AVATAR_PIZZA, |
| 101 AVATAR_SOCCER, | 101 AVATAR_SOCCER, |
| 102 AVATAR_BURGER, | 102 AVATAR_BURGER, |
| 103 AVATAR_CAT, | 103 AVATAR_CAT, |
| 104 AVATAR_CUPCAKE, // 20 | 104 AVATAR_CUPCAKE, // 20 |
| 105 AVATAR_DOG, | 105 AVATAR_DOG, |
| 106 AVATAR_HORSE, | 106 AVATAR_HORSE, |
| 107 AVATAR_MARGARITA, | 107 AVATAR_MARGARITA, |
| 108 AVATAR_NOTE, | 108 AVATAR_NOTE, |
| 109 AVATAR_SUN_CLOUD, | 109 AVATAR_SUN_CLOUD, |
| 110 AVATAR_PLACEHOLDER, | 110 AVATAR_UNKNOWN, // 26 |
| 111 AVATAR_UNKNOWN, // 27 | 111 AVATAR_GAIA, // 27 |
| 112 AVATAR_GAIA, // 28 | |
| 113 NUM_PROFILE_AVATAR_METRICS | 112 NUM_PROFILE_AVATAR_METRICS |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 void ProfileMetrics::UpdateReportedProfilesStatistics(ProfileManager* manager) { | 115 void ProfileMetrics::UpdateReportedProfilesStatistics(ProfileManager* manager) { |
| 117 ProfileCounts counts; | 116 ProfileCounts counts; |
| 118 if (CountProfileInformation(manager, &counts)) { | 117 if (CountProfileInformation(manager, &counts)) { |
| 119 int limited_total = counts.total; | 118 int limited_total = counts.total; |
| 120 int limited_signedin = counts.signedin; | 119 int limited_signedin = counts.signedin; |
| 121 if (limited_total > kMaximumReportedProfileCount) { | 120 if (limited_total > kMaximumReportedProfileCount) { |
| 122 limited_total = kMaximumReportedProfileCount + 1; | 121 limited_total = kMaximumReportedProfileCount + 1; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 break; | 230 break; |
| 232 case 23: | 231 case 23: |
| 233 icon_name = AVATAR_MARGARITA; | 232 icon_name = AVATAR_MARGARITA; |
| 234 break; | 233 break; |
| 235 case 24: | 234 case 24: |
| 236 icon_name = AVATAR_NOTE; | 235 icon_name = AVATAR_NOTE; |
| 237 break; | 236 break; |
| 238 case 25: | 237 case 25: |
| 239 icon_name = AVATAR_SUN_CLOUD; | 238 icon_name = AVATAR_SUN_CLOUD; |
| 240 break; | 239 break; |
| 241 case 26: | 240 case 27: |
| 242 icon_name = AVATAR_PLACEHOLDER; | |
| 243 break; | |
| 244 case 28: | |
| 245 icon_name = AVATAR_GAIA; | 241 icon_name = AVATAR_GAIA; |
| 246 break; | 242 break; |
| 247 default: // We should never actually get here. | 243 default: // We should never actually get here. |
| 248 NOTREACHED(); | 244 NOTREACHED(); |
| 249 break; | 245 break; |
| 250 } | 246 } |
| 251 UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name, | 247 UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name, |
| 252 NUM_PROFILE_AVATAR_METRICS); | 248 NUM_PROFILE_AVATAR_METRICS); |
| 253 } | 249 } |
| 254 | 250 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", | 301 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", |
| 306 GetProfileType(profile_path), | 302 GetProfileType(profile_path), |
| 307 NUM_PROFILE_TYPE_METRICS); | 303 NUM_PROFILE_TYPE_METRICS); |
| 308 } | 304 } |
| 309 | 305 |
| 310 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { | 306 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { |
| 311 UMA_HISTOGRAM_ENUMERATION("Profile.Update", | 307 UMA_HISTOGRAM_ENUMERATION("Profile.Update", |
| 312 GetProfileType(profile_path), | 308 GetProfileType(profile_path), |
| 313 NUM_PROFILE_TYPE_METRICS); | 309 NUM_PROFILE_TYPE_METRICS); |
| 314 } | 310 } |
| OLD | NEW |