summaryrefslogtreecommitdiff
path: root/chromium/components/metrics/metrics_service_client.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-12 15:59:20 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-25 06:57:22 +0000
commitf7eaed5286974984ba5f9e3189d8f49d03e99f81 (patch)
treecaed19b2af2024f35449fb0b781d0a25e09d4f8f /chromium/components/metrics/metrics_service_client.h
parent9729c4479fe23554eae6e6dd1f30ff488f470c84 (diff)
downloadqtwebengine-chromium-f7eaed5286974984ba5f9e3189d8f49d03e99f81.tar.gz
BASELINE: Update Chromium to 100.0.4896.167
Change-Id: I98cbeb5d7543d966ffe04d8cefded0c493a11333 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/metrics/metrics_service_client.h')
-rw-r--r--chromium/components/metrics/metrics_service_client.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/chromium/components/metrics/metrics_service_client.h b/chromium/components/metrics/metrics_service_client.h
index 2296f20b5a7..63ef4017065 100644
--- a/chromium/components/metrics/metrics_service_client.h
+++ b/chromium/components/metrics/metrics_service_client.h
@@ -6,7 +6,6 @@
#define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_
#include <stdint.h>
-
#include <memory>
#include <string>
@@ -204,6 +203,27 @@ class MetricsServiceClient {
// should no-op for other platforms.
virtual void UpdateCurrentUserMetricsConsent(bool user_metrics_consent) {}
+ // Returns the current user metrics consent if it should be applied to decide
+ // the current metrics reporting state. This allows embedders to determine
+ // when a user metric consent state should not be applied (ie no logged in
+ // user or managed policy).
+ //
+ // Will return absl::nullopt if there is no current user or current user
+ // metrics consent should not be applied to determine metrics reporting state.
+ //
+ // Not all platforms support per-user consent. If per-user consent is not
+ // supported, this function should return absl::nullopt.
+ virtual absl::optional<bool> GetCurrentUserMetricsConsent() const;
+
+ // Returns the current user id.
+ //
+ // Will return absl::nullopt if there is no current user, metrics reporting is
+ // disabled, or current user should not have a user id.
+ //
+ // Not all platforms support per-user consent. If per-user consent is not
+ // supported, this function should return absl::nullopt.
+ virtual absl::optional<std::string> GetCurrentUserId() const;
+
private:
base::RepeatingClosure update_running_services_;
};