1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_METRICS_ENABLED_STATE_PROVIDER_H_
6 #define COMPONENTS_METRICS_ENABLED_STATE_PROVIDER_H_
10 // An interface that provides whether metrics should be reported.
11 class EnabledStateProvider {
13 virtual ~EnabledStateProvider() {}
15 // Indicates that the user has provided consent to collect and report metrics.
16 virtual bool IsConsentGiven() const = 0;
18 // Should collection and reporting be enabled. This should depend on consent
20 virtual bool IsReportingEnabled() const;
22 // Enable or disable checking whether field trials are forced or not at
23 // EnabledStateProvider::IsReportingEnabled().
24 static void SetIgnoreForceFieldTrialsForTesting(bool ignore_trials);
27 } // namespace metrics
29 #endif // COMPONENTS_METRICS_ENABLED_STATE_PROVIDER_H_