1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/login/enrollment/enrollment_uma.h"
7 #include "base/logging.h"
8 #include "base/metrics/sparse_histogram.h"
12 const char * const kMetricEnrollment
= "Enterprise.Enrollment";
13 const char * const kMetricEnrollmentForced
= "Enterprise.EnrollmentForced";
14 const char * const kMetricEnrollmentRecovery
= "Enterprise.EnrollmentRecovery";
20 void EnrollmentUMA(policy::MetricEnrollment sample
,
21 policy::EnrollmentConfig::Mode mode
) {
23 case policy::EnrollmentConfig::MODE_MANUAL
:
24 case policy::EnrollmentConfig::MODE_MANUAL_REENROLLMENT
:
25 case policy::EnrollmentConfig::MODE_LOCAL_ADVERTISED
:
26 case policy::EnrollmentConfig::MODE_SERVER_ADVERTISED
:
27 UMA_HISTOGRAM_SPARSE_SLOWLY(kMetricEnrollment
, sample
);
29 case policy::EnrollmentConfig::MODE_LOCAL_FORCED
:
30 case policy::EnrollmentConfig::MODE_SERVER_FORCED
:
31 UMA_HISTOGRAM_SPARSE_SLOWLY(kMetricEnrollmentForced
, sample
);
33 case policy::EnrollmentConfig::MODE_RECOVERY
:
34 UMA_HISTOGRAM_SPARSE_SLOWLY(kMetricEnrollmentRecovery
, sample
);
36 case policy::EnrollmentConfig::MODE_NONE
:
42 } // namespace chromeos