• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2022 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.
4 
5 #ifndef COMPONENTS_METRICS_UI_FORM_FACTOR_METRICS_PROVIDER_H_
6 #define COMPONENTS_METRICS_UI_FORM_FACTOR_METRICS_PROVIDER_H_
7 
8 #include "components/metrics/metrics_provider.h"
9 #include "third_party/metrics_proto/system_profile.pb.h"
10 
11 namespace metrics {
12 
13 // Provides metrics related to the device's form factor.
14 class FormFactorMetricsProvider : public MetricsProvider {
15  public:
16   FormFactorMetricsProvider() = default;
17 
18   FormFactorMetricsProvider(const FormFactorMetricsProvider&) = delete;
19   FormFactorMetricsProvider& operator=(const FormFactorMetricsProvider&) =
20       delete;
21 
22   ~FormFactorMetricsProvider() override = default;
23 
24   // MetricsProvider:
25   void ProvideSystemProfileMetrics(
26       SystemProfileProto* system_profile_proto) override;
27 
28  protected:
29   // Returns the device's form factor. Protected and virtual for testing.
30   virtual SystemProfileProto::Hardware::FormFactor GetFormFactor() const;
31 };
32 
33 }  // namespace metrics
34 
35 #endif  // COMPONENTS_METRICS_UI_FORM_FACTOR_METRICS_PROVIDER_H_
36