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.
5 #ifndef COMPONENTS_METRICS_MOTHERBOARD_H_
6 #define COMPONENTS_METRICS_MOTHERBOARD_H_
10 #include "third_party/abseil-cpp/absl/types/optional.h"
14 class Motherboard final {
16 enum class BiosType { kLegacy, kUefi };
18 Motherboard(Motherboard&&);
19 Motherboard(const Motherboard&) = delete;
22 // The fields below provide details about Motherboard and BIOS on the system.
24 // A `nullopt_t` means that the property does not exist/could not be read.
25 // A valid value could be an UTF-8 string with characters or an empty string.
27 // This `absl::optional` can be mapped directly to the optional proto message
28 // field, where the message field is added only if there is a valid value.
29 const absl::optional<std::string>& manufacturer() const {
32 const absl::optional<std::string>& model() const { return model_; }
33 const absl::optional<std::string>& bios_manufacturer() const {
34 return bios_manufacturer_;
36 const absl::optional<std::string>& bios_version() const {
39 absl::optional<BiosType> bios_type() const { return bios_type_; }
42 absl::optional<std::string> manufacturer_;
43 absl::optional<std::string> model_;
44 absl::optional<std::string> bios_manufacturer_;
45 absl::optional<std::string> bios_version_;
46 absl::optional<BiosType> bios_type_;
49 } // namespace metrics
51 #endif // COMPONENTS_METRICS_MOTHERBOARD_H_