form_factor_metrics_provider.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2022 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_FORM_FACTOR_METRICS_PROVIDER_H_
  5. #define COMPONENTS_METRICS_FORM_FACTOR_METRICS_PROVIDER_H_
  6. #include "components/metrics/metrics_provider.h"
  7. #include "third_party/metrics_proto/system_profile.pb.h"
  8. namespace metrics {
  9. // Provides metrics related to the device's form factor.
  10. class FormFactorMetricsProvider : public MetricsProvider {
  11. public:
  12. FormFactorMetricsProvider() = default;
  13. FormFactorMetricsProvider(const FormFactorMetricsProvider&) = delete;
  14. FormFactorMetricsProvider& operator=(const FormFactorMetricsProvider&) =
  15. delete;
  16. ~FormFactorMetricsProvider() override = default;
  17. // MetricsProvider:
  18. void ProvideSystemProfileMetrics(
  19. SystemProfileProto* system_profile_proto) override;
  20. protected:
  21. // Returns the device's form factor. Protected and virtual for testing.
  22. virtual SystemProfileProto::Hardware::FormFactor GetFormFactor() const;
  23. };
  24. } // namespace metrics
  25. #endif // COMPONENTS_METRICS_FORM_FACTOR_METRICS_PROVIDER_H_