#include "chrome/browser/ui/tabs/organization/trigger_policies.h"
#include <cmath>
#include <numbers>
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "chrome/browser/metrics/desktop_session_duration/desktop_session_duration_tracker.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/tabs/organization/prefs.h"
#include "components/prefs/pref_service.h"
UsageTickClock::UsageTickClock(const base::TickClock* base_clock)
: … { … }
UsageTickClock::~UsageTickClock() { … }
base::TimeTicks UsageTickClock::NowTicks() const { … }
void UsageTickClock::OnSessionStarted(base::TimeTicks session_start) { … }
void UsageTickClock::OnSessionEnded(base::TimeDelta session_length,
base::TimeTicks session_end) { … }
ProfilePrefBackoffLevelProvider::ProfilePrefBackoffLevelProvider(
content::BrowserContext* context)
: … { … }
ProfilePrefBackoffLevelProvider::~ProfilePrefBackoffLevelProvider() = default;
unsigned int ProfilePrefBackoffLevelProvider::Get() const { … }
void ProfilePrefBackoffLevelProvider::Increment() { … }
void ProfilePrefBackoffLevelProvider::Decrement() { … }
TargetFrequencyTriggerPolicy::TargetFrequencyTriggerPolicy(
std::unique_ptr<base::TickClock> clock,
base::TimeDelta base_period,
float backoff_base,
BackoffLevelProvider* backoff_level_provider)
: … { … }
TargetFrequencyTriggerPolicy::~TargetFrequencyTriggerPolicy() = default;
bool TargetFrequencyTriggerPolicy::ShouldTrigger(float score) { … }
void TargetFrequencyTriggerPolicy::OnTriggerSucceeded() { … }
void TargetFrequencyTriggerPolicy::OnTriggerFailed() { … }
bool DemoTriggerPolicy::ShouldTrigger(float score) { … }