1 // Copyright (c) 2013 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 "components/policy/core/common/policy_load_status.h"
7 #include "base/metrics/histogram.h"
8 #include "base/strings/stringprintf.h"
9 #include "components/policy/core/common/policy_types.h"
15 const char kHistogramName
[] = "Enterprise.PolicyLoadStatus";
19 PolicyLoadStatusSample::PolicyLoadStatusSample()
20 : histogram_(base::LinearHistogram::FactoryGet(
21 kHistogramName
, 1, POLICY_LOAD_STATUS_SIZE
,
22 POLICY_LOAD_STATUS_SIZE
+ 1,
23 base::Histogram::kUmaTargetedHistogramFlag
)) {
24 Add(POLICY_LOAD_STATUS_STARTED
);
27 PolicyLoadStatusSample::~PolicyLoadStatusSample() {
28 for (int i
= 0; i
< POLICY_LOAD_STATUS_SIZE
; ++i
) {
34 void PolicyLoadStatusSample::Add(PolicyLoadStatus status
) {
35 status_bits_
[status
] = true;