#include "components/breadcrumbs/core/breadcrumbs_status.h"
#include <atomic>
#include <optional>
#include "base/command_line.h"
#include "base/rand_util.h"
#include "base/time/time.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/variations/variations_switches.h"
#include "components/version_info/channel.h"
namespace breadcrumbs {
namespace {
enum class BreadcrumbsEnabledMode { … };
std::atomic<BreadcrumbsEnabledMode> breadcrumbs_enabled_mode = …;
constexpr int kCanaryPercent = …;
constexpr int kDevPercent = …;
constexpr int kBetaPercent = …;
constexpr int kStablePercent = …;
constexpr auto kEnabledDuration = …;
bool GetRandomIsEnabled(version_info::Channel channel) { … }
bool HasRecentBreadcrumbsPrefs(PrefService* prefs) { … }
bool IsEnabled(PrefService* prefs,
std::optional<version_info::Channel> set_for_channel) { … }
}
constexpr char kEnabledPref[] = …;
constexpr char kEnabledTimePref[] = …;
bool IsEnabled(PrefService* prefs) { … }
bool MaybeEnableBasedOnChannel(PrefService* prefs,
version_info::Channel channel) { … }
void RegisterPrefs(PrefRegistrySimple* registry) { … }
ScopedEnableBreadcrumbsForTesting::ScopedEnableBreadcrumbsForTesting() { … }
ScopedEnableBreadcrumbsForTesting::~ScopedEnableBreadcrumbsForTesting() { … }
}