Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(329)

Unified Diff: ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.cc

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.cc
diff --git a/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.cc b/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.cc
index 1b57dacf31eb8d93589ee780291e69b3f4b5c728..a26f12f6e7e78ed11eeb55c719beb6023f8eff40 100644
--- a/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.cc
+++ b/ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.cc
@@ -75,9 +75,11 @@ void DesktopPromotionSyncObserver::OnStateChanged(syncer::SyncService* sync) {
int entrypoint_prefixes_count =
arraysize(kDesktopIOSPromotionEntrypointHistogramPrefix);
for (int i = 1; i < entrypoint_prefixes_count + 1; i++) {
+ // Note this fakes an enum UMA using an exact linear UMA, since the enum is
+ // a modification of another enum, but isn't defined directly.
if (sms_entrypoint == i) {
- UMA_HISTOGRAM_ENUMERATION("DesktopIOSPromotion.SMSSent.IOSSigninReason",
- i, entrypoint_prefixes_count + 1);
+ UMA_HISTOGRAM_EXACT_LINEAR("DesktopIOSPromotion.SMSSent.IOSSigninReason",
+ i, entrypoint_prefixes_count + 1);
// If the time delta is negative due to client bad clock we log 0 instead.
base::Histogram::FactoryGet(
base::StringPrintf(
@@ -89,8 +91,8 @@ void DesktopPromotionSyncObserver::OnStateChanged(syncer::SyncService* sync) {
// If the user saw this promotion type, log that it could be a reason
// for the signin.
if ((1 << i) & shown_entrypoints)
- UMA_HISTOGRAM_ENUMERATION("DesktopIOSPromotion.NoSMS.IOSSigninReason",
- i, entrypoint_prefixes_count + 1);
+ UMA_HISTOGRAM_EXACT_LINEAR("DesktopIOSPromotion.NoSMS.IOSSigninReason",
+ i, entrypoint_prefixes_count + 1);
}
}

Powered by Google App Engine
This is Rietveld 408576698