Chromium Code Reviews| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIADefault", metric, | 358 UMA_HISTOGRAM_ENUMERATION("Profile.DesktopMenu.GAIADefault", metric, |
| 359 NUM_PROFILE_DESKTOP_MENU_METRICS); | 359 NUM_PROFILE_DESKTOP_MENU_METRICS); |
| 360 break; | 360 break; |
| 361 } | 361 } |
| 362 } | 362 } |
| 363 | 363 |
| 364 void ProfileMetrics::LogProfileDelete(bool profile_was_signed_in) { | 364 void ProfileMetrics::LogProfileDelete(bool profile_was_signed_in) { |
| 365 UMA_HISTOGRAM_BOOLEAN("Profile.Delete", profile_was_signed_in); | 365 UMA_HISTOGRAM_BOOLEAN("Profile.Delete", profile_was_signed_in); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void ProfileMetrics::LogProfileDesktopSignin(ProfileDesktopSignin metric) { | |
| 369 DCHECK(metric < NUM_PROFILE_DESKTOP_SIGNIN_METRICS); | |
|
Alexei Svitkine (slow)
2014/08/14 17:59:46
Nit: Can this be DCHECK_LT? Same below.
Mike Lerman
2014/08/14 18:15:30
Didn't know that was an option. Done, thanks!
| |
| 370 UMA_HISTOGRAM_ENUMERATION("Profile.NewAvatarMenu.Signin", metric, | |
| 371 NUM_PROFILE_DESKTOP_SIGNIN_METRICS); | |
| 372 } | |
| 373 | |
| 374 void ProfileMetrics::LogProfileNewAvatarMenuFRE( | |
| 375 ProfileNewAvatarMenuFRE metric) { | |
| 376 DCHECK(metric < NUM_PROFILE_AVATAR_MENU_UPGRADE_METRICS); | |
| 377 UMA_HISTOGRAM_ENUMERATION("Profile.NewAvatarMenu.FirstRun", metric, | |
| 378 NUM_PROFILE_AVATAR_MENU_UPGRADE_METRICS); | |
| 379 } | |
| 380 | |
| 381 void ProfileMetrics::LogProfileNewAvatarMenuNotYou( | |
| 382 ProfileNewAvatarMenuNotYou metric) { | |
| 383 DCHECK(metric < NUM_PROFILE_AVATAR_MENU_NOT_YOU_METRICS); | |
| 384 UMA_HISTOGRAM_ENUMERATION("Profile.NewAvatarMenu.NotYou", metric, | |
| 385 NUM_PROFILE_AVATAR_MENU_NOT_YOU_METRICS); | |
| 386 } | |
| 387 | |
| 368 #if defined(OS_ANDROID) | 388 #if defined(OS_ANDROID) |
| 369 void ProfileMetrics::LogProfileAndroidAccountManagementMenu( | 389 void ProfileMetrics::LogProfileAndroidAccountManagementMenu( |
| 370 ProfileAndroidAccountManagementMenu metric, | 390 ProfileAndroidAccountManagementMenu metric, |
| 371 signin::GAIAServiceType gaia_service) { | 391 signin::GAIAServiceType gaia_service) { |
| 372 // The first parameter to the histogram needs to be literal, because of the | 392 // The first parameter to the histogram needs to be literal, because of the |
| 373 // optimized implementation of |UMA_HISTOGRAM_ENUMERATION|. Do not attempt | 393 // optimized implementation of |UMA_HISTOGRAM_ENUMERATION|. Do not attempt |
| 374 // to refactor. | 394 // to refactor. |
| 375 switch (gaia_service) { | 395 switch (gaia_service) { |
| 376 case signin::GAIA_SERVICE_TYPE_NONE: | 396 case signin::GAIA_SERVICE_TYPE_NONE: |
| 377 UMA_HISTOGRAM_ENUMERATION( | 397 UMA_HISTOGRAM_ENUMERATION( |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", | 449 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", |
| 430 GetProfileType(profile_path), | 450 GetProfileType(profile_path), |
| 431 NUM_PROFILE_TYPE_METRICS); | 451 NUM_PROFILE_TYPE_METRICS); |
| 432 } | 452 } |
| 433 | 453 |
| 434 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { | 454 void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { |
| 435 UMA_HISTOGRAM_ENUMERATION("Profile.Update", | 455 UMA_HISTOGRAM_ENUMERATION("Profile.Update", |
| 436 GetProfileType(profile_path), | 456 GetProfileType(profile_path), |
| 437 NUM_PROFILE_TYPE_METRICS); | 457 NUM_PROFILE_TYPE_METRICS); |
| 438 } | 458 } |
| OLD | NEW |