OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/arc/arc_optin_uma.h" | 5 #include "chrome/browser/chromeos/arc/arc_optin_uma.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/metrics/histogram_functions.h" | 9 #include "base/metrics/histogram_functions.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 base::UmaHistogramCustomTimes(histogram_name, elapsed_time, | 57 base::UmaHistogramCustomTimes(histogram_name, elapsed_time, |
58 base::TimeDelta::FromSeconds(1) /* minimum */, | 58 base::TimeDelta::FromSeconds(1) /* minimum */, |
59 base::TimeDelta::FromMinutes(3) /* maximum */, | 59 base::TimeDelta::FromMinutes(3) /* maximum */, |
60 50 /* bucket_count */); | 60 50 /* bucket_count */); |
61 } | 61 } |
62 | 62 |
63 void UpdateAuthCheckinAttempts(int32_t num_attempts) { | 63 void UpdateAuthCheckinAttempts(int32_t num_attempts) { |
64 UMA_HISTOGRAM_SPARSE_SLOWLY("ArcAuth.CheckinAttempts", num_attempts); | 64 UMA_HISTOGRAM_SPARSE_SLOWLY("ArcAuth.CheckinAttempts", num_attempts); |
65 } | 65 } |
66 | 66 |
67 void UpdateAuthAccountCheckStatus(AccountCheckStatus status) { | |
68 UMA_HISTOGRAM_ENUMERATION("ArcAuth.AccountCheckStatus", | |
69 static_cast<int>(status), | |
70 static_cast<int>(AccountCheckStatus::SIZE)); | |
dcheng
2017/03/25 00:55:04
Hmm... this doesn't work without the static cast?
khmel
2017/03/25 01:24:14
Thank for caring this case! I confirmed that this
| |
71 } | |
72 | |
67 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) { | 73 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) { |
68 UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state), | 74 UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state), |
69 static_cast<int>(OptInSilentAuthCode::SIZE)); | 75 static_cast<int>(OptInSilentAuthCode::SIZE)); |
70 } | 76 } |
71 | 77 |
72 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result) { | 78 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result) { |
73 #define MAP_PROVISIONING_RESULT(name) \ | 79 #define MAP_PROVISIONING_RESULT(name) \ |
74 case ProvisioningResult::name: \ | 80 case ProvisioningResult::name: \ |
75 return os << #name | 81 return os << #name |
76 | 82 |
(...skipping 24 matching lines...) Expand all Loading... | |
101 | 107 |
102 #undef MAP_PROVISIONING_RESULT | 108 #undef MAP_PROVISIONING_RESULT |
103 | 109 |
104 // Some compilers report an error even if all values of an enum-class are | 110 // Some compilers report an error even if all values of an enum-class are |
105 // covered exhaustively in a switch statement. | 111 // covered exhaustively in a switch statement. |
106 NOTREACHED() << "Invalid value " << static_cast<int>(result); | 112 NOTREACHED() << "Invalid value " << static_cast<int>(result); |
107 return os; | 113 return os; |
108 } | 114 } |
109 | 115 |
110 } // namespace arc | 116 } // namespace arc |
OLD | NEW |