chromium/components/feature_engagement/public/configuration.h

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_FEATURE_ENGAGEMENT_PUBLIC_CONFIGURATION_H_
#define COMPONENTS_FEATURE_ENGAGEMENT_PUBLIC_CONFIGURATION_H_

#include <map>
#include <optional>
#include <ostream>
#include <set>
#include <string>
#include <unordered_set>
#include <vector>

#include "base/feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"

namespace feature_engagement {

#if BUILDFLAG(IS_CHROMEOS_ASH)
class ConfigurationProvider;
#endif

// Max number of days for storing client side event data, ~10 years.
constexpr uint32_t kMaxStoragePeriod =;

// A ComparatorType describes the relationship between two numbers.
enum ComparatorType {};

// A Comparator provides a way of comparing a uint32_t another uint32_t and
// verifying their relationship.
struct Comparator {};

bool operator==(const Comparator& lhs, const Comparator& rhs);
bool operator<(const Comparator& lhs, const Comparator& rhs);
std::ostream& operator<<(std::ostream& os, const Comparator& comparator);

// A EventConfig contains all the information about how many times
// a particular event should or should not have triggered, for which window
// to search in and for how long to store it.
struct EventConfig {};

bool operator==(const EventConfig& lhs, const EventConfig& rhs);
bool operator!=(const EventConfig& lhs, const EventConfig& rhs);
bool operator<(const EventConfig& lhs, const EventConfig& rhs);
std::ostream& operator<<(std::ostream& os, const EventConfig& event_config);

// A SessionRateImpact describes which features the |session_rate| of a given
// FeatureConfig should affect. It can affect either |ALL| (default), |NONE|,
// or an |EXPLICIT| list of the features. In the latter case, a list of affected
// features is given as their base::Feature name.
struct SessionRateImpact {};

bool operator==(const SessionRateImpact& lhs, const SessionRateImpact& rhs);
std::ostream& operator<<(std::ostream& os, const SessionRateImpact& impact);

// BlockedBy describes which features the |blocked_by| of a given
// FeatureConfig should affect. It can affect either |ALL| (default), |NONE|,
// or an |EXPLICIT| list of the features. In the latter case, a list of affected
// features is given as their base::Feature name.
struct BlockedBy {};

bool operator==(const BlockedBy& lhs, const BlockedBy& rhs);
std::ostream& operator<<(std::ostream& os, const BlockedBy& impact);

// Blocking describes which features the |blocking| of a given FeatureConfig
// should affect. It can affect either |ALL| (default) or |NONE|.
struct Blocking {};

bool operator==(const Blocking& lhs, const Blocking& rhs);
std::ostream& operator<<(std::ostream& os, const Blocking& impact);

// A SnoozeParams describes the parameters for snoozable options of in-product
// help.
struct SnoozeParams {};

bool operator==(const SnoozeParams& lhs, const SnoozeParams& rhs);
std::ostream& operator<<(std::ostream& os, const SnoozeParams& impact);

// A FeatureConfig contains all the configuration for a given feature.
struct FeatureConfig {};

bool operator==(const FeatureConfig& lhs, const FeatureConfig& rhs);
std::ostream& operator<<(std::ostream& os, const FeatureConfig& feature_config);

// A GroupConfig contains all the configuration for a given group.
struct GroupConfig {};

bool operator==(const GroupConfig& lhs, const GroupConfig& rhs);
std::ostream& operator<<(std::ostream& os, const GroupConfig& feature_config);

// A Configuration contains the current set of runtime configurations.
// It is up to each implementation of Configuration to provide a way to
// register features and their configurations.
class Configuration {};

}  // namespace feature_engagement

#endif  // COMPONENTS_FEATURE_ENGAGEMENT_PUBLIC_CONFIGURATION_H_