1 // Copyright 2018 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.
4 
5 #include "chromeos/components/proximity_auth/smart_lock_metrics_recorder.h"
6 
7 #include "base/metrics/histogram_macros.h"
8 
9 SmartLockMetricsRecorder::SmartLockMetricsRecorder() = default;
10 
~SmartLockMetricsRecorder()11 SmartLockMetricsRecorder::~SmartLockMetricsRecorder() {}
12 
RecordSmartLockUnlockAuthMethodChoice(SmartLockAuthMethodChoice auth_method_choice)13 void SmartLockMetricsRecorder::RecordSmartLockUnlockAuthMethodChoice(
14     SmartLockAuthMethodChoice auth_method_choice) {
15   UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.Unlock",
16                             auth_method_choice);
17 }
18 
RecordSmartLockSignInAuthMethodChoice(SmartLockAuthMethodChoice auth_method_choice)19 void SmartLockMetricsRecorder::RecordSmartLockSignInAuthMethodChoice(
20     SmartLockAuthMethodChoice auth_method_choice) {
21   UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.SignIn",
22                             auth_method_choice);
23 }
24 
RecordAuthResultUnlockSuccess(bool success)25 void SmartLockMetricsRecorder::RecordAuthResultUnlockSuccess(bool success) {
26   UMA_HISTOGRAM_BOOLEAN("SmartLock.AuthResult.Unlock", success);
27 }
28 
RecordAuthResultUnlockFailure(SmartLockAuthResultFailureReason failure_reason)29 void SmartLockMetricsRecorder::RecordAuthResultUnlockFailure(
30     SmartLockAuthResultFailureReason failure_reason) {
31   RecordAuthResultUnlockSuccess(false);
32   UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthResult.Unlock.Failure",
33                             failure_reason);
34 }
35 
RecordAuthResultSignInSuccess(bool success)36 void SmartLockMetricsRecorder::RecordAuthResultSignInSuccess(bool success) {
37   UMA_HISTOGRAM_BOOLEAN("SmartLock.AuthResult.SignIn", success);
38 }
39 
RecordAuthResultSignInFailure(SmartLockAuthResultFailureReason failure_reason)40 void SmartLockMetricsRecorder::RecordAuthResultSignInFailure(
41     SmartLockAuthResultFailureReason failure_reason) {
42   RecordAuthResultSignInSuccess(false);
43   UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthResult.SignIn.Failure",
44                             failure_reason);
45 }
46 
RecordAuthMethodChoiceUnlockPasswordState(SmartLockAuthEventPasswordState password_state)47 void SmartLockMetricsRecorder::RecordAuthMethodChoiceUnlockPasswordState(
48     SmartLockAuthEventPasswordState password_state) {
49   UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.Unlock.PasswordState",
50                             password_state);
51 }
52 
RecordAuthMethodChoiceSignInPasswordState(SmartLockAuthEventPasswordState password_state)53 void SmartLockMetricsRecorder::RecordAuthMethodChoiceSignInPasswordState(
54     SmartLockAuthEventPasswordState password_state) {
55   UMA_HISTOGRAM_ENUMERATION("SmartLock.AuthMethodChoice.SignIn.PasswordState",
56                             password_state);
57 }
58