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" |
11 | 11 |
12 namespace arc { | 12 namespace arc { |
13 | 13 |
14 void UpdateOptInActionUMA(OptInActionType type) { | 14 void UpdateOptInActionUMA(OptInActionType type) { |
15 UMA_HISTOGRAM_ENUMERATION("Arc.OptInAction", static_cast<int>(type), | 15 UMA_HISTOGRAM_ENUMERATION("Arc.OptInAction", static_cast<int>(type), |
16 static_cast<int>(OptInActionType::SIZE)); | 16 static_cast<int>(OptInActionType::SIZE)); |
17 } | 17 } |
18 | 18 |
19 void UpdateOptInCancelUMA(OptInCancelReason reason) { | 19 void UpdateOptInCancelUMA(OptInCancelReason reason) { |
20 UMA_HISTOGRAM_ENUMERATION("Arc.OptInCancel", static_cast<int>(reason), | 20 UMA_HISTOGRAM_ENUMERATION("Arc.OptInCancel", static_cast<int>(reason), |
21 static_cast<int>(OptInCancelReason::SIZE)); | 21 static_cast<int>(OptInCancelReason::SIZE)); |
22 } | 22 } |
23 | 23 |
24 void UpdateEnabledStateUMA(bool enabled) { | 24 void UpdateEnabledStateUMA(bool enabled) { |
25 UMA_HISTOGRAM_BOOLEAN("Arc.State", enabled); | 25 UMA_HISTOGRAM_BOOLEAN("Arc.State", enabled); |
26 } | 26 } |
27 | 27 |
| 28 void UpdateOptInFlowResultUMA(OptInFlowResult result) { |
| 29 UMA_HISTOGRAM_ENUMERATION("Arc.OptInResult", static_cast<int>(result), |
| 30 static_cast<int>(OptInFlowResult::SIZE)); |
| 31 } |
| 32 |
28 void UpdateProvisioningResultUMA(ProvisioningResult result, bool managed) { | 33 void UpdateProvisioningResultUMA(ProvisioningResult result, bool managed) { |
29 DCHECK_NE(result, ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR); | 34 DCHECK_NE(result, ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR); |
30 std::string histogram_name = "Arc.Provisioning.Result."; | 35 std::string histogram_name = "Arc.Provisioning.Result."; |
31 histogram_name += managed ? "Managed" : "Unmanaged"; | 36 histogram_name += managed ? "Managed" : "Unmanaged"; |
32 base::LinearHistogram::FactoryGet( | 37 base::LinearHistogram::FactoryGet( |
33 histogram_name, 0, static_cast<int>(ProvisioningResult::SIZE), | 38 histogram_name, 0, static_cast<int>(ProvisioningResult::SIZE), |
34 static_cast<int>(ProvisioningResult::SIZE) + 1, | 39 static_cast<int>(ProvisioningResult::SIZE) + 1, |
35 base::HistogramBase::kUmaTargetedHistogramFlag) | 40 base::HistogramBase::kUmaTargetedHistogramFlag) |
36 ->Add(static_cast<int>(result)); | 41 ->Add(static_cast<int>(result)); |
37 } | 42 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 113 |
109 #undef MAP_PROVISIONING_RESULT | 114 #undef MAP_PROVISIONING_RESULT |
110 | 115 |
111 // Some compilers report an error even if all values of an enum-class are | 116 // Some compilers report an error even if all values of an enum-class are |
112 // covered exhaustively in a switch statement. | 117 // covered exhaustively in a switch statement. |
113 NOTREACHED() << "Invalid value " << static_cast<int>(result); | 118 NOTREACHED() << "Invalid value " << static_cast<int>(result); |
114 return os; | 119 return os; |
115 } | 120 } |
116 | 121 |
117 } // namespace arc | 122 } // namespace arc |
OLD | NEW |