SmartCard: Add permissions-related histograms
This adds collection of two permisions-related histograms:
- SmartCardConnectionClosedReason: records reasons why smart card
connections are severed.
- SmartCardOneTimePermissionExpiryReason: records reasons why ephemeral
smart card permissions expired.
Bug: 414627373
Change-Id: I766e073f0d4985daf60b4cb9597770b7a422644a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6519661
Commit-Queue: Luke Klimek <[email protected]>
Reviewed-by: Simon Hangl <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1457606}
diff --git a/chrome/browser/smart_card/smart_card_histograms.cc b/chrome/browser/smart_card/smart_card_histograms.cc
new file mode 100644
index 0000000..8bf84bc
--- /dev/null
+++ b/chrome/browser/smart_card/smart_card_histograms.cc
@@ -0,0 +1,13 @@
+// Copyright 2025 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/smart_card/smart_card_histograms.h"
+
+#include "base/metrics/histogram_macros.h"
+
+void RecordSmartCardOneTimePermissionExpiryReason(
+ SmartCardOneTimePermissionExpiryReason reason) {
+ UMA_HISTOGRAM_ENUMERATION("SmartCard.OneTimePermissionExpiryReason", reason,
+ kSmartCardPermissionExpiredMax);
+}