blob: e0dedcf3ff194be07e8d0e5b7a50aba19aa46855 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/components/proximity_auth/smart_lock_metrics_recorder.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
SmartLockMetricsRecorder::SmartLockMetricsRecorder() = default;
SmartLockMetricsRecorder::~SmartLockMetricsRecorder() {}
void SmartLockMetricsRecorder::RecordSmartLockUnlockAuthMethodChoice(
SmartLockAuthMethodChoice auth_method_choice) {
UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.Unlock",
auth_method_choice);
}
void SmartLockMetricsRecorder::RecordSmartLockSignInAuthMethodChoice(
SmartLockAuthMethodChoice auth_method_choice) {
UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.SignIn",
auth_method_choice);
}
void SmartLockMetricsRecorder::RecordAuthResultUnlockSuccess(bool success) {
UMA_HISTOGRAM_BOOLEAN("SmartLock.AuthResult.Unlock", success);
}
void SmartLockMetricsRecorder::RecordAuthResultUnlockFailure(
SmartLockAuthResultFailureReason failure_reason) {
RecordAuthResultUnlockSuccess(false);
UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthResult.Unlock.Failure",
failure_reason);
}
void SmartLockMetricsRecorder::RecordGetRemoteStatusResultUnlockSuccess(
bool success) {
UMA_HISTOGRAM_BOOLEAN("SmartLock.GetRemoteStatus.Unlock", success);
}
void SmartLockMetricsRecorder::RecordGetRemoteStatusResultUnlockFailure(
SmartLockGetRemoteStatusResultFailureReason failure_reason) {
RecordGetRemoteStatusResultUnlockSuccess(false);
UMA_HISTOGRAM_ENUMERATION("SmartLock.GetRemoteStatus.Unlock.Failure",
failure_reason);
}
void SmartLockMetricsRecorder::RecordAuthResultSignInSuccess(bool success) {
UMA_HISTOGRAM_BOOLEAN("SmartLock.AuthResult.SignIn", success);
}
void SmartLockMetricsRecorder::RecordAuthResultSignInFailure(
SmartLockAuthResultFailureReason failure_reason) {
RecordAuthResultSignInSuccess(false);
UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthResult.SignIn.Failure",
failure_reason);
}
void SmartLockMetricsRecorder::RecordGetRemoteStatusResultSignInSuccess(
bool success) {
UMA_HISTOGRAM_BOOLEAN("SmartLock.GetRemoteStatus.SignIn", success);
}
void SmartLockMetricsRecorder::RecordGetRemoteStatusResultSignInFailure(
SmartLockGetRemoteStatusResultFailureReason failure_reason) {
RecordGetRemoteStatusResultSignInSuccess(false);
UMA_HISTOGRAM_ENUMERATION("SmartLock.GetRemoteStatus.SignIn.Failure",
failure_reason);
}
void SmartLockMetricsRecorder::RecordAuthMethodChoiceUnlockPasswordState(
SmartLockAuthEventPasswordState password_state) {
UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.Unlock.PasswordState",
password_state);
}
void SmartLockMetricsRecorder::RecordAuthMethodChoiceSignInPasswordState(
SmartLockAuthEventPasswordState password_state) {
UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.SignIn.PasswordState",
password_state);
}