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

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

Issue 2705493002: [Merge-57] arc: Logging ARC data removal reasons (Closed)
Patch Set: Created 3 years, 10 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
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 "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 8
9 namespace arc { 9 namespace arc {
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 base::TimeDelta::FromMinutes(6), 50, 47 base::TimeDelta::FromMinutes(6), 50,
48 base::HistogramBase::kUmaTargetedHistogramFlag) 48 base::HistogramBase::kUmaTargetedHistogramFlag)
49 ->AddTime(elapsed_time); 49 ->AddTime(elapsed_time);
50 } 50 }
51 51
52 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) { 52 void UpdateSilentAuthCodeUMA(OptInSilentAuthCode state) {
53 UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state), 53 UMA_HISTOGRAM_ENUMERATION("Arc.OptInSilentAuthCode", static_cast<int>(state),
54 static_cast<int>(OptInSilentAuthCode::SIZE)); 54 static_cast<int>(OptInSilentAuthCode::SIZE));
55 } 55 }
56 56
57 std::ostream& operator<<(std::ostream& os, const ProvisioningResult& result) {
58 #define MAP_PROVISIONING_RESULT(name) \
59 case ProvisioningResult::name: \
60 return os << #name
61
62 switch (result) {
63 MAP_PROVISIONING_RESULT(SUCCESS);
64 MAP_PROVISIONING_RESULT(UNKNOWN_ERROR);
65 MAP_PROVISIONING_RESULT(GMS_NETWORK_ERROR);
66 MAP_PROVISIONING_RESULT(GMS_SERVICE_UNAVAILABLE);
67 MAP_PROVISIONING_RESULT(GMS_BAD_AUTHENTICATION);
68 MAP_PROVISIONING_RESULT(DEVICE_CHECK_IN_FAILED);
69 MAP_PROVISIONING_RESULT(CLOUD_PROVISION_FLOW_FAILED);
70 MAP_PROVISIONING_RESULT(MOJO_VERSION_MISMATCH);
71 MAP_PROVISIONING_RESULT(MOJO_CALL_TIMEOUT);
72 MAP_PROVISIONING_RESULT(DEVICE_CHECK_IN_TIMEOUT);
73 MAP_PROVISIONING_RESULT(DEVICE_CHECK_IN_INTERNAL_ERROR);
74 MAP_PROVISIONING_RESULT(GMS_SIGN_IN_FAILED);
75 MAP_PROVISIONING_RESULT(GMS_SIGN_IN_TIMEOUT);
76 MAP_PROVISIONING_RESULT(GMS_SIGN_IN_INTERNAL_ERROR);
77 MAP_PROVISIONING_RESULT(CLOUD_PROVISION_FLOW_TIMEOUT);
78 MAP_PROVISIONING_RESULT(CLOUD_PROVISION_FLOW_INTERNAL_ERROR);
79 MAP_PROVISIONING_RESULT(ARC_STOPPED);
80 MAP_PROVISIONING_RESULT(OVERALL_SIGN_IN_TIMEOUT);
81 MAP_PROVISIONING_RESULT(CHROME_SERVER_COMMUNICATION_ERROR);
82 MAP_PROVISIONING_RESULT(SIZE);
83 }
84
85 #undef MAP_PROVISIONING_RESULT
86
87 // Some compilers report an error even if all values of an enum-class are
88 // covered exhaustively in a switch statement.
89 NOTREACHED() << "Invalid value " << static_cast<int>(result);
90 return os;
91 }
92
57 } // namespace arc 93 } // namespace arc
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/arc/arc_optin_uma.h ('k') | chrome/browser/chromeos/arc/arc_session_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698