| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 105 |
| 101 #undef MAP_PROVISIONING_RESULT | 106 #undef MAP_PROVISIONING_RESULT |
| 102 | 107 |
| 103 // Some compilers report an error even if all values of an enum-class are | 108 // Some compilers report an error even if all values of an enum-class are |
| 104 // covered exhaustively in a switch statement. | 109 // covered exhaustively in a switch statement. |
| 105 NOTREACHED() << "Invalid value " << static_cast<int>(result); | 110 NOTREACHED() << "Invalid value " << static_cast<int>(result); |
| 106 return os; | 111 return os; |
| 107 } | 112 } |
| 108 | 113 |
| 109 } // namespace arc | 114 } // namespace arc |
| OLD | NEW |