enabled_state_provider.h 786 B

12345678910111213141516171819202122232425
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_METRICS_ENABLED_STATE_PROVIDER_H_
  5. #define COMPONENTS_METRICS_ENABLED_STATE_PROVIDER_H_
  6. namespace metrics {
  7. // An interface that provides whether metrics should be reported.
  8. class EnabledStateProvider {
  9. public:
  10. virtual ~EnabledStateProvider() {}
  11. // Indicates that the user has provided consent to collect and report metrics.
  12. virtual bool IsConsentGiven() const = 0;
  13. // Should collection and reporting be enabled. This should depend on consent
  14. // being given.
  15. virtual bool IsReportingEnabled() const;
  16. };
  17. } // namespace metrics
  18. #endif // COMPONENTS_METRICS_ENABLED_STATE_PROVIDER_H_