File: enterprise_metrics.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (479 lines) | stat: -rw-r--r-- 25,451 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENTERPRISE_METRICS_H_
#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENTERPRISE_METRICS_H_

#include "build/build_config.h"
#include "components/policy/policy_export.h"

namespace policy {

// Metrics collected for enterprise events.

// Events related to device enrollment.
// This enum is used to define the buckets for an enumerated UMA histogram with
// the name of EnterpriseEnrollmentType.
// Hence,
//   (a) existing enumerated constants should never be deleted or reordered, and
//   (b) new constants should only be appended at the end of the enumeration
//       (update tools/metrics/histograms/enums.xml as well).
enum MetricEnrollment {
  // User pressed 'Cancel' during the enrollment process.
  kMetricEnrollmentCancelled = 0,
  // User started enrollment process by submitting valid credentials.
  kMetricEnrollmentStarted = 1,
  // OAuth token fetch failed: network error.
  kMetricEnrollmentNetworkFailed = 2,
  // OAuth token fetch failed: login error.
  kMetricEnrollmentLoginFailed = 3,
  // Registration / policy fetch failed: DM server reports management not
  // supported.
  kMetricEnrollmentNotSupported = 4,
  /* kMetricEnrollmentPolicyFailed = 5 REMOVED */
  /* kMetricEnrollmentOtherFailed = 6 REMOVED */
  // Enrollment was successful.
  kMetricEnrollmentOK = 7,
  // Registration / policy fetch failed: DM server reports that the serial
  // number we try to register is not assigned to the domain used.
  kMetricEnrollmentRegisterPolicyInvalidSerial = 8,
  /* kMetricEnrollmentAutoStarted = 9 REMOVED */
  /* kMetricEnrollmentAutoFailed = 10 REMOVED */
  /* kMetricEnrollmentAutoRestarted = 11 REMOVED */
  /* kMetricEnrollmentAutoCancelled = 12 REMOVED */
  /* kMetricEnrollmentAutoOK = 13 REMOVED */
  // Registration failed: DM server returns unknown/disallowed enrollment mode.
  kMetricEnrollmentInvalidEnrollmentMode = 14,
  /* kMetricEnrollmentAutoEnrollmentNotSupported = 15 REMOVED */
  // Lockbox initialization took too long to complete.
  kMetricEnrollmentLockboxTimeoutError = 16,
  // Lockbox error at re-enrollment: domain does not match install attributes.
  kMetricEnrollmentLockDomainMismatch = 17,
  // Registration / policy fetch failed: DM server reports licenses expired or
  // exhausted.
  kMetricEnrollmentRegisterPolicyMissingLicenses = 18,
  // Failed to fetch device robot authorization code from DM Server.
  kMetricEnrollmentRobotAuthCodeFetchFailed = 19,
  // Failed to fetch device robot refresh token from GAIA.
  kMetricEnrollmentRobotRefreshTokenFetchFailed = 20,
  // Failed to persist robot account refresh token on device.
  kMetricEnrollmentRobotRefreshTokenStoreFailed = 21,
  // Registration / policy fetch failed: DM server reports administrator
  // deprovisioned the device.
  kMetricEnrollmentRegisterPolicyDeprovisioned = 22,
  // Registration / policy fetch failed: DM server reports domain mismatch.
  kMetricEnrollmentRegisterPolicyDomainMismatch = 23,
  // Enrollment has been triggered, the webui login screen has been shown.
  kMetricEnrollmentTriggered = 24,
  // The user submitted valid credentials to start the enrollment process
  // for the second (or further) time.
  kMetricEnrollmentRestarted = 25,
  /* kMetricEnrollmentStoreTokenAndIdFailed = 26 REMOVED */
  // Failed to obtain FRE state keys.
  kMetricEnrollmentNoStateKeys = 27,
  // Failed to validate policy.
  kMetricEnrollmentPolicyValidationFailed = 28,
  // Failed due to error in CloudPolicyStore.
  kMetricEnrollmentCloudPolicyStoreError = 29,
  /* kMetricEnrollmentLockBackendError = 30 REMOVED */
  // Registration / policy fetch failed: DM server reports invalid request
  // payload.
  kMetricEnrollmentRegisterPolicyPayloadInvalid = 31,
  // Registration / policy fetch failed: DM server reports device not found.
  kMetricEnrollmentRegisterPolicyDeviceNotFound = 32,
  // Registration / policy fetch failed: DM server reports DM token invalid.
  kMetricEnrollmentRegisterPolicyDMTokenInvalid = 33,
  // Registration / policy fetch failed: DM server reports activation pending.
  kMetricEnrollmentRegisterPolicyActivationPending = 34,
  // Registration / policy fetch failed: DM server reports device ID conflict.
  kMetricEnrollmentRegisterPolicyDeviceIdConflict = 35,
  // Registration / policy fetch failed: DM server can't find policy.
  kMetricEnrollmentRegisterPolicyNotFound = 36,
  // Registration / policy fetch failed: HTTP request failed.
  kMetricEnrollmentRegisterPolicyRequestFailed = 37,
  // Registration / policy fetch failed: DM server reports temporary problem.
  kMetricEnrollmentRegisterPolicyTempUnavailable = 38,
  // Registration / policy fetch failed: DM server returns non-success HTTP
  // status code.
  kMetricEnrollmentRegisterPolicyHttpError = 39,
  // Registration / policy fetch failed: can't decode DM server response.
  kMetricEnrollmentRegisterPolicyResponseInvalid = 40,
  // OAuth token fetch failed: account not signed up.
  kMetricEnrollmentAccountNotSignedUp = 41,
  /* kMetricEnrollmentAccountDeleted = 42 REMOVED */
  /* kMetricEnrollmentAccountDisabled = 43 REMOVED */
  // Re-enrollment pre-check failed: domain does not match install attributes.
  kMetricEnrollmentPrecheckDomainMismatch = 44,
  // Lockbox backend failed to initialize.
  kMetricEnrollmentLockBackendInvalid = 45,
  // Lockbox backend (TPM) already locked.
  kMetricEnrollmentLockAlreadyLocked = 46,
  // Lockbox failure setting attributes.
  kMetricEnrollmentLockSetError = 47,
  // Lockbox failure during locking.
  kMetricEnrollmentLockFinalizeError = 48,
  // Lockbox read back is inconsistent.
  kMetricEnrollmentLockReadbackError = 49,
  // Failed to update device attributes.
  kMetricEnrollmentAttributeUpdateFailed = 50,
  // Enrollment mode does not match already locked install attributes.
  kMetricEnrollmentLockModeMismatch = 51,
  // A registration certificate could not be fetched from the PCA.
  kMetricEnrollmentRegistrationCertificateFetchFailed = 52,
  // The request to enroll could not be signed.
  kMetricEnrollmentRegisterCannotSignRequest = 53,
  // Device model or serial number missing from VPD.
  kMetricEnrollmentNoDeviceIdentification = 54,
  // Active Directory policy fetch failed.
  kMetricEnrollmentActiveDirectoryPolicyFetchFailed = 55,
  // Failed to store DM token into the local state.
  kMetricEnrollmentStoreDMTokenFailed = 56,
  // Failed to get available licenses.
  kMetricEnrollmentLicenseRequestFailed = 57,
  // Registration failed: Consumer account with packaged license.
  kMetricEnrollmentRegisterConsumerAccountWithPackagedLicense = 58,
  // Device was not pre-provisioned for Zero-Touch.
  kMetricEnrollmentDeviceNotPreProvisioned = 59,
  // Enrollment failed: Enterprise account is not eligible to enroll.
  kMetricEnrollmentRegisterEnterpriseAccountIsNotEligibleToEnroll = 60,
  // Enrollment failed: Enterprise TOS has not been accepted.
  kMetricEnrollmentRegisterEnterpriseTosHasNotBeenAccepted = 61,
  // Too many requests are uploadede within a short time.
  kMetricEnrollmentTooManyRequests = 62,
  // Enrollment failed: illegal account for packaged EDU license.
  kMetricEnrollmentIllegalAccountForPackagedEDULicense = 63,
  // Enrollment failed: dev mode would be blocked but this is prevented by a
  // command-line switch.
  kMetricEnrollmentMayNotBlockDevMode = 64,
  // Enrollment failed: Packaged license device invalid for KIOSK.
  kMetricEnrollmentInvalidPackagedDeviceForKIOSK = 65,
  // A registration certificate could not be fetched from the PCA due to
  // unspecified failure.
  kMetricEnrollmentRegistrationCertificateFetchUnspecifiedFailure = 66,
  // A registration certificate could not be fetched from the PCA due to
  // bad request.
  kMetricEnrollmentRegistrationCertificateFetchBadRequest = 67,
  // A registration certificate could not be fetched from the PCA due to
  // attestation not being available.
  kMetricEnrollmentRegistrationCertificateFetchNotAvailable = 68,
  // Enrollment failed: Organization unit enrollment limit exceeded.
  kMetricEnrollmentOrgUnitEnrollmentLimitExceeded = 69,
  // Max value for use with enumeration histogram UMA functions.
  kMaxValue = kMetricEnrollmentOrgUnitEnrollmentLimitExceeded
};

// Events related to policy refresh.
// This enum is used to define the buckets for an enumerated UMA histogram.
// Hence,
//   (a) existing enumerated constants should never be deleted or reordered, and
//   (b) new constants should only be appended at the end of the enumeration
//       (update tools/metrics/histograms/enums.xml as well).
enum MetricPolicyRefresh {
  // A refresh occurred while the policy was not invalidated and the policy was
  // changed. Invalidations were enabled.
  METRIC_POLICY_REFRESH_CHANGED = 0,
  // A refresh occurred while the policy was not invalidated and the policy was
  // changed. Invalidations were disabled.
  METRIC_POLICY_REFRESH_CHANGED_NO_INVALIDATIONS = 1,
  // A refresh occurred while the policy was not invalidated and the policy was
  // unchanged.
  METRIC_POLICY_REFRESH_UNCHANGED = 2,
  // A refresh occurred while the policy was invalidated and the policy was
  // changed.
  METRIC_POLICY_REFRESH_INVALIDATED_CHANGED = 3,
  // A refresh occurred while the policy was invalidated and the policy was
  // unchanged.
  METRIC_POLICY_REFRESH_INVALIDATED_UNCHANGED = 4,

  METRIC_POLICY_REFRESH_SIZE  // Must be the last.
};

// Types of policy invalidations.
// This enum is used to define the buckets for an enumerated UMA histogram.
// Hence,
//   (a) existing enumerated constants should never be deleted or reordered, and
//   (b) new constants should only be appended at the end of the enumeration
//       (update tools/metrics/histograms/enums.xml as well).
enum PolicyInvalidationType {
  // The invalidation contained no payload.
  POLICY_INVALIDATION_TYPE_NO_PAYLOAD = 0,
  // A normal invalidation containing a payload.
  POLICY_INVALIDATION_TYPE_NORMAL = 1,
  // The invalidation contained no payload and was considered expired.
  POLICY_INVALIDATION_TYPE_NO_PAYLOAD_EXPIRED = 3,
  // The invalidation contained a payload and was considered expired.
  POLICY_INVALIDATION_TYPE_EXPIRED = 4,

  POLICY_INVALIDATION_TYPE_SIZE  // Must be the last.
};

// Result of the Device ID field validation in policy protobufs.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class PolicyDeviceIdValidity {
  kValid = 0,
  kActualIdUnknown = 1,
  kMissing = 2,
  kInvalid = 3,
  kMaxValue = kInvalid,  // Must be the last.
};

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class PolicyPromotionBannerAction {
  kBannerDismissed = 0,
  kBannerRedirected = 1,
  kMaxValue = kBannerRedirected,  // Must be the last.
};

// Names for the UMA counters. They are shared from here since the events
// from the same enum above can be triggered in different files, and must use
// the same UMA histogram name.
// Metrics name from UMA dashboard cloud be used in codesearch as is, so please
// keep the names without format specifiers (e.g. %s) or add a comment how the
// name could be expanded.
inline constexpr char kMetricUserPolicyRefresh[] = "Enterprise.PolicyRefresh2";

inline constexpr char kMetricUserPolicyInvalidations[] =
    "Enterprise.PolicyInvalidations";

inline constexpr char kMetricDevicePolicyRefresh[] =
    "Enterprise.DevicePolicyRefresh3";

inline constexpr char kMetricDevicePolicyInvalidations[] =
    "Enterprise.DevicePolicyInvalidations2";

inline constexpr char kMetricDeviceLocalAccountPolicyRefresh[] =
    "Enterprise.DeviceLocalAccountPolicyRefresh3";

inline constexpr char kMetricDeviceLocalAccountPolicyInvalidations[] =
    "Enterprise.DeviceLocalAccountPolicyInvalidations2";

inline constexpr char kMetricCBCMPolicyRefresh[] =
    "Enterprise.CBCMPolicyRefresh";

inline constexpr char kMetricCBCMPolicyInvalidations[] =
    "Enterprise.CBCMPolicyInvalidations";

inline constexpr char kMetricUserRemoteCommandInvalidations[] =
    "Enterprise.UserRemoteCommandInvalidations";
inline constexpr char kMetricDeviceRemoteCommandInvalidations[] =
    "Enterprise.DeviceRemoteCommandInvalidations";
inline constexpr char kMetricCBCMRemoteCommandInvalidations[] =
    "Enterprise.CBCMRemoteCommandInvalidations";

inline constexpr char kMetricUserRemoteCommandReceived[] =
    "Enterprise.UserRemoteCommand.Received";

// Expands to:
// Enterprise.UserRemoteCommand.Executed.CommandEchoTest
// Enterprise.UserRemoteCommand.Executed.DeviceReboot
// Enterprise.UserRemoteCommand.Executed.DeviceScreenshot
// Enterprise.UserRemoteCommand.Executed.DeviceSetVolume
// Enterprise.UserRemoteCommand.Executed.DeviceStartCrdSession
// Enterprise.UserRemoteCommand.Executed.DeviceFetchStatus
// Enterprise.UserRemoteCommand.Executed.UserArcCommand
// Enterprise.UserRemoteCommand.Executed.DeviceWipeUsers
// Enterprise.UserRemoteCommand.Executed.DeviceRefreshEnterpriseMachineCertificate
// Enterprise.UserRemoteCommand.Executed.DeviceRemotePowerwash
// Enterprise.UserRemoteCommand.Executed.DeviceGetAvailableDiagnosticRoutines
// Enterprise.UserRemoteCommand.Executed.DeviceRunDiagnosticRoutine
// Enterprise.UserRemoteCommand.Executed.DeviceGetDiagnosticRoutineUpdate
// Enterprise.UserRemoteCommand.Executed.BrowserClearBrowsingData
// Enterprise.UserRemoteCommand.Executed.DeviceResetEuicc
// Enterprise.UserRemoteCommand.Executed.BrowserRotateAttestationCredential
// Enterprise.UserRemoteCommand.Executed.FetchCrdAvailabilityInfo
// Enterprise.UserRemoteCommand.Executed.FetchSupportPacket
inline constexpr char kMetricUserRemoteCommandExecutedTemplate[] =
    "Enterprise.UserRemoteCommand.Executed.%s";

inline constexpr char kMetricDeviceRemoteCommandReceived[] =
    "Enterprise.DeviceRemoteCommand.Received";

// Expands To:
// Enterprise.DeviceRemoteCommand.Crd.Unknown.UnknownUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.Unknown.AutoLaunchedKioskSession.Result
// Enterprise.DeviceRemoteCommand.Crd.Unknown.ManuallyLaunchedKioskSession.Result
// Enterprise.DeviceRemoteCommand.Crd.Unknown.AffiliatedUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.Unknown.UnaffiliatedUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.Unknown.ManagedGuestSession.Result
// Enterprise.DeviceRemoteCommand.Crd.Unknown.GuestSession.Result
// Enterprise.DeviceRemoteCommand.Crd.Unknown.NoUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.UnknownUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.AutoLaunchedKioskSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.ManuallyLaunchedKioskSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.AffiliatedUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.UnaffiliatedUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.ManagedGuestSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.GuestSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.NoUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.UnknownUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.AutoLaunchedKioskSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.ManuallyLaunchedKioskSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.AffiliatedUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.UnaffiliatedUserSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.ManagedGuestSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.GuestSession.Result
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.NoUserSession.Result
inline constexpr char kMetricDeviceRemoteCommandCrdResultTemplate[] =
    "Enterprise.DeviceRemoteCommand.Crd.%s.%s.Result";

// ExpandsTo:
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.UnknownUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.AutoLaunchedKioskSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.ManuallyLaunchedKioskSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.AffiliatedUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.UnaffiliatedUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.ManagedGuestSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.GuestSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteAccess.NoUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.UnknownUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.AutoLaunchedKioskSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.ManuallyLaunchedKioskSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.AffiliatedUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.UnaffiliatedUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.ManagedGuestSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.GuestSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.RemoteSupport.NoUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.UnknownUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.AutoLaunchedKioskSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.ManuallyLaunchedKioskSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.AffiliatedUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.UnaffiliatedUserSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.ManagedGuestSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.GuestSession.SessionDuration
// Enterprise.DeviceRemoteCommand.Crd.Unknown.NoUserSession.SessionDuration
inline constexpr char kMetricDeviceRemoteCommandCrdSessionDurationTemplate[] =
    "Enterprise.DeviceRemoteCommand.Crd.%s.%s.SessionDuration";

// Expands to:
// Enterprise.DeviceRemoteCommand.Executed.CommandEchoTest
// Enterprise.DeviceRemoteCommand.Executed.DeviceReboot
// Enterprise.DeviceRemoteCommand.Executed.DeviceScreenshot
// Enterprise.DeviceRemoteCommand.Executed.DeviceSetVolume
// Enterprise.DeviceRemoteCommand.Executed.DeviceStartCrdSession
// Enterprise.DeviceRemoteCommand.Executed.DeviceFetchStatus
// Enterprise.DeviceRemoteCommand.Executed.UserArcCommand
// Enterprise.DeviceRemoteCommand.Executed.DeviceWipeUsers
// Enterprise.DeviceRemoteCommand.Executed.DeviceRefreshEnterpriseMachineCertificate
// Enterprise.DeviceRemoteCommand.Executed.DeviceRemotePowerwash
// Enterprise.DeviceRemoteCommand.Executed.DeviceGetAvailableDiagnosticRoutines
// Enterprise.DeviceRemoteCommand.Executed.DeviceRunDiagnosticRoutine
// Enterprise.DeviceRemoteCommand.Executed.DeviceGetDiagnosticRoutineUpdate
// Enterprise.DeviceRemoteCommand.Executed.BrowserClearBrowsingData
// Enterprise.DeviceRemoteCommand.Executed.DeviceResetEuicc
// Enterprise.DeviceRemoteCommand.Executed.BrowserRotateAttestationCredential
// Enterprise.DeviceRemoteCommand.Executed.FetchCrdAvailabilityInfo
inline constexpr char kMetricDeviceRemoteCommandExecutedTemplate[] =
    "Enterprise.DeviceRemoteCommand.Executed.%s";

inline constexpr char kMetricCBCMRemoteCommandReceived[] =
    "Enterprise.CBCMRemoteCommand.Received";

// Expands to:
// Enterprise.CBCMRemoteCommand.Executed.CommandEchoTest
// Enterprise.CBCMRemoteCommand.Executed.DeviceReboot
// Enterprise.CBCMRemoteCommand.Executed.DeviceScreenshot
// Enterprise.CBCMRemoteCommand.Executed.DeviceSetVolume
// Enterprise.CBCMRemoteCommand.Executed.DeviceStartCrdSession
// Enterprise.CBCMRemoteCommand.Executed.DeviceFetchStatus
// Enterprise.CBCMRemoteCommand.Executed.UserArcCommand
// Enterprise.CBCMRemoteCommand.Executed.DeviceWipeUsers
// Enterprise.CBCMRemoteCommand.Executed.DeviceRefreshEnterpriseMachineCertificate
// Enterprise.CBCMRemoteCommand.Executed.DeviceRemotePowerwash
// Enterprise.CBCMRemoteCommand.Executed.DeviceGetAvailableDiagnosticRoutines
// Enterprise.CBCMRemoteCommand.Executed.DeviceRunDiagnosticRoutine
// Enterprise.CBCMRemoteCommand.Executed.DeviceGetDiagnosticRoutineUpdate
// Enterprise.CBCMRemoteCommand.Executed.BrowserClearBrowsingData
// Enterprise.CBCMRemoteCommand.Executed.DeviceResetEuicc
// Enterprise.CBCMRemoteCommand.Executed.BrowserRotateAttestationCredential
// Enterprise.CBCMRemoteCommand.Executed.FetchCrdAvailabilityInfo
inline constexpr char kMetricCBCMRemoteCommandExecutedTemplate[] =
    "Enterprise.CBCMRemoteCommand.Executed.%s";

// Private set membership UMA histogram names.
inline constexpr char kUMAPsmSuccessTime[] =
    "Enterprise.AutoEnrollmentPrivateSetMembershipSuccessTime";
inline constexpr char kUMAPsmResult[] = "Enterprise.AutoEnrollmentPsmResult";
inline constexpr char kUMAPsmNetworkErrorCode[] =
    "Enterprise.AutoEnrollmentPsmRequestNetworkErrorCode";
inline constexpr char kUMAPsmDmServerRequestStatus[] =
    "Enterprise.AutoEnrollmentPsmDmServerRequestStatus";

// The following UMA suffixes are used by Hash dance and PSM protocols.
// Suffix for initial enrollment.
inline constexpr char kUMASuffixInitialEnrollment[] = ".InitialEnrollment";
// Suffix for Forced Re-Enrollment.
inline constexpr char kUMASuffixFRE[] = ".ForcedReenrollment";

// Histograms for the unified state determination.
inline constexpr char kUMAStateDeterminationDeviceIdentifierStatus[] =
    "Enterprise.StateDetermination.DeviceIdentifierStatus";
inline constexpr char kUMAStateDeterminationEnabled[] =
    "Enterprise.StateDetermination.Enabled";
inline constexpr char kUMAStateDeterminationOnFlex[] =
    "Enterprise.StateDetermination.OnFlex";
inline constexpr char kUMAStateDeterminationOwnershipStatus[] =
    "Enterprise.StateDetermination.OwnershipStatus";
inline constexpr char
    kUMAStateDeterminationOwnershipStatusDuringEnrollmentRecovery[] =
        "Enterprise.StateDetermination.OwnershipStatusDuringEnrollmentRecovery";
inline constexpr char kUMAStateDeterminationPsmReportedAvailableState[] =
    "Enterprise.StateDetermination.PsmReportedAvailableState";
inline constexpr char kUMAStateDeterminationPsmRlweOprfRequestDmStatusCode[] =
    "Enterprise.StateDetermination.PsmRlweOprfRequest.DmStatusCode";
inline constexpr char
    kUMAStateDeterminationPsmRlweOprfRequestNetworkErrorCode[] =
    "Enterprise.StateDetermination.PsmRlweOprfRequest.NetworkErrorCode";
inline constexpr char kUMAStateDeterminationPsmRlweQueryRequestDmStatusCode[] =
    "Enterprise.StateDetermination.PsmRlweQueryRequest.DmStatusCode";
inline constexpr char
    kUMAStateDeterminationPsmRlweQueryRequestNetworkErrorCode[] =
    "Enterprise.StateDetermination.PsmRlweQueryRequest.NetworkErrorCode";
inline constexpr char kUMAStateDeterminationStateKeysRetrievalErrorType[] =
    "Enterprise.StateDetermination.StateKeys.RetrievalErrorType";
inline constexpr char kUMAStateDeterminationStateRequestDmStatusCode[] =
    "Enterprise.StateDetermination.StateRequest.DmStatusCode";
inline constexpr char kUMAStateDeterminationStateRequestNetworkErrorCode[] =
    "Enterprise.StateDetermination.StateRequest.NetworkErrorCode";
inline constexpr char kUMAStateDeterminationStateReturned[] =
    "Enterprise.StateDetermination.StateReturned";
inline constexpr char kUMAStateDeterminationStepDuration[] =
    "Enterprise.StateDetermination.StepDuration";
inline constexpr char kUMAStateDeterminationTotalDurationByState[] =
    "Enterprise.StateDetermination.TotalDurationByState";
inline constexpr char kUMAStateDeterminationTotalDuration[] =
    "Enterprise.StateDetermination.TotalDuration";
inline constexpr char kUMAStateDeterminationStatus[] =
    "Enterprise.StateDetermination.Status";
inline constexpr char kUMAStateDeterminationIsInitialByState[] =
    "Enterprise.StateDetermination.IsInitialByState";

inline constexpr char kUMAPrefixEnrollmentTokenBasedOOBEConfig[] =
    "Enterprise.TokenBasedEnrollmentOobeConfig";

// Suffixes added to kUMAStateDeterminationTotalDurationByState.
inline constexpr char kUMASuffixConnectionError[] = ".ConnectionError";
inline constexpr char kUMASuffixStateKeysRetrievalError[] =
    ".StateKeysRetrievalError";
inline constexpr char kUMASuffixDisabled[] = ".Disabled";
inline constexpr char kUMASuffixEnrollment[] = ".Enrollment";
inline constexpr char kUMASuffixNoEnrollment[] = ".NoEnrollment";
inline constexpr char kUMASuffixServerError[] = ".ServerError";

// Suffixes added to kUMAStateDeterminationStepDuration.
inline constexpr char kUMASuffixOPRFRequest[] = ".OPRFRequest";
inline constexpr char kUMASuffixOwnershipCheck[] = ".OwnershipCheck";
inline constexpr char kUMASuffixQueryRequest[] = ".QueryRequest";
inline constexpr char kUMASuffixStateKeysRetrieval[] = ".StateKeysRetrieval";
inline constexpr char kUMASuffixStateRequest[] = ".StateRequest";

// Histograms for the promotion banner on chrome://policy
inline constexpr char kUMAPolicyBannerDisplayed[] =
    "Enterprise.PolicyPromotionBannerDisplayed";
inline constexpr char kUMAPolicyBannerAction[] =
    "Enterprise.PolicyPromotionBannerAction";
}  // namespace policy

#endif  // COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENTERPRISE_METRICS_H_