chromium/chrome/browser/enterprise/connectors/device_trust/key_management/installer/metrics_util.h

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_KEY_MANAGEMENT_INSTALLER_METRICS_UTIL_H_
#define CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_KEY_MANAGEMENT_INSTALLER_METRICS_UTIL_H_

namespace enterprise_connectors {

// Status of rotation attempts made with Rotate().
// Must be kept in sync with the DeviceTrustKeyRotationStatus UMA enum.
enum class RotationStatus {};

// Metrics for the Rotate result. `is_rotation` is used to differentiate a
// create from a rotate attempt and `status` is the result of the action.
void RecordRotationStatus(bool is_rotation, RotationStatus status);

// Metrics for the network delegates upload key result. `is_rotate` is used to
// differentiate a create from a rotate attempt and `status_code` is the HTTP
// response code from the upload key request.
void RecordUploadCode(bool is_rotation, int status_code);

}  // namespace enterprise_connectors

#endif  // CHROME_BROWSER_ENTERPRISE_CONNECTORS_DEVICE_TRUST_KEY_MANAGEMENT_INSTALLER_METRICS_UTIL_H_