Elim cr-checkbox
[chromium-blink-merge.git] / chrome / browser / chromeos / login / enrollment / enrollment_uma.cc
blobd45766ae6472b08913b8816645fcfd5a48af853f
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"
10 namespace {
12 const char * const kMetricEnrollment = "Enterprise.Enrollment";
13 const char * const kMetricEnrollmentForced = "Enterprise.EnrollmentForced";
14 const char * const kMetricEnrollmentRecovery = "Enterprise.EnrollmentRecovery";
16 } // namespace
18 namespace chromeos {
20 void EnrollmentUMA(policy::MetricEnrollment sample,
21 policy::EnrollmentConfig::Mode mode) {
22 switch (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);
28 break;
29 case policy::EnrollmentConfig::MODE_LOCAL_FORCED:
30 case policy::EnrollmentConfig::MODE_SERVER_FORCED:
31 UMA_HISTOGRAM_SPARSE_SLOWLY(kMetricEnrollmentForced, sample);
32 break;
33 case policy::EnrollmentConfig::MODE_RECOVERY:
34 UMA_HISTOGRAM_SPARSE_SLOWLY(kMetricEnrollmentRecovery, sample);
35 break;
36 case policy::EnrollmentConfig::MODE_NONE:
37 NOTREACHED();
38 break;
42 } // namespace chromeos