blob: 794deea40f4c796e811430dec4a7a6e291cde19f [file] [log] [blame]
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_QUICK_PAIR_COMMON_FAST_PAIR_FAST_PAIR_FEATURE_USAGE_METRICS_LOGGER_H_
#define ASH_QUICK_PAIR_COMMON_FAST_PAIR_FAST_PAIR_FEATURE_USAGE_METRICS_LOGGER_H_
#include "base/component_export.h"
#include "chromeos/components/feature_usage/feature_usage_metrics.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace ash {
namespace quick_pair {
// Tracks Fast Pair feature usage for the Standard Feature Usage Logging
// (SFUL) framework.
class COMPONENT_EXPORT(QUICK_PAIR_COMMON)
FastPairFeatureUsageMetricsLogger final
: public feature_usage::FeatureUsageMetrics::Delegate {
public:
FastPairFeatureUsageMetricsLogger();
FastPairFeatureUsageMetricsLogger(const FastPairFeatureUsageMetricsLogger&) =
delete;
FastPairFeatureUsageMetricsLogger& operator=(
const FastPairFeatureUsageMetricsLogger&) = delete;
~FastPairFeatureUsageMetricsLogger() override;
// feature_usage::FeatureUsageMetrics::Delegate:
bool IsEligible() const override;
bool IsEnabled() const override;
absl::optional<bool> IsAccessible() const override;
void RecordUsage(bool success);
private:
feature_usage::FeatureUsageMetrics feature_usage_metrics_;
};
} // namespace quick_pair
} // namespace ash
#endif // ASH_QUICK_PAIR_COMMON_FAST_PAIR_FAST_PAIR_FEATURE_USAGE_METRICS_LOGGER_H_