Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: chrome/browser/chromeos/arc/arc_optin_uma.cc

Issue 2771943003: arc: Skip GMS Sign-In in case Android is already signed-in. (Closed)
Patch Set: use sparse UMA Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | components/arc/common/auth.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(mojom::AccountCheckStatus status) {
68 DCHECK_LE(status, mojom::AccountCheckStatus::CHECK_FAILED);
69 UMA_HISTOGRAM_ENUMERATION(
70 "ArcAuth.AccountCheckStatus", static_cast<int>(status),
71 static_cast<int>(mojom::AccountCheckStatus::CHECK_FAILED) + 1);
72 }
73
67 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) { 74 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) {
68 UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state), 75 UMA_HISTOGRAM_SPARSE_SLOWLY("Arc.OptInSilentAuthCode",
69 static_cast<int>(OptInSilentAuthCode::SIZE)); 76 static_cast<int>(state));
70 } 77 }
71 78
72 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result) { 79 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result) {
73 #define MAP_PROVISIONING_RESULT(name) \ 80 #define MAP_PROVISIONING_RESULT(name) \
74 case ProvisioningResult::name: \ 81 case ProvisioningResult::name: \
75 return os << #name 82 return os << #name
76 83
77 switch (result) { 84 switch (result) {
78 MAP_PROVISIONING_RESULT(SUCCESS); 85 MAP_PROVISIONING_RESULT(SUCCESS);
79 MAP_PROVISIONING_RESULT(UNKNOWN_ERROR); 86 MAP_PROVISIONING_RESULT(UNKNOWN_ERROR);
(...skipping 21 matching lines...) Expand all
101 108
102 #undef MAP_PROVISIONING_RESULT 109 #undef MAP_PROVISIONING_RESULT
103 110
104 // Some compilers report an error even if all values of an enum-class are 111 // Some compilers report an error even if all values of an enum-class are
105 // covered exhaustively in a switch statement. 112 // covered exhaustively in a switch statement.
106 NOTREACHED() << "Invalid value " << static_cast<int>(result); 113 NOTREACHED() << "Invalid value " << static_cast<int>(result);
107 return os; 114 return os;
108 } 115 }
109 116
110 } // namespace arc 117 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | components/arc/common/auth.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698