chromium/chrome/browser/ui/tabs/organization/trigger.h

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

#ifndef CHROME_BROWSER_UI_TABS_ORGANIZATION_TRIGGER_H_
#define CHROME_BROWSER_UI_TABS_ORGANIZATION_TRIGGER_H_

#include <memory>

#include "base/functional/callback.h"

class BackoffLevelProvider;
class TabStripModel;

// Decides whether to trigger the nudge UI. Can incorporate considerations such
// as rate limiting / backoff, historical score distribution, historical CTR for
// this user, etc.
class TriggerPolicy {};

TriggerScoringFunction;

// Decides when to trigger the tab organization proactive nudge UI by scoring
// potential trigger moments and picking the best one based on a score threshold
// and trigger policy.
class TabOrganizationTrigger {};

TriggerScoringFunction GetTriggerScoringFunction();
float GetTriggerScoreThreshold();
float GetSensitivityThreshold();
std::unique_ptr<TriggerPolicy> GetTriggerPolicy(
    BackoffLevelProvider* backoff_level_provider);

std::unique_ptr<TabOrganizationTrigger> MakeTrigger(
    BackoffLevelProvider* backoff_level_provider);

#endif  // CHROME_BROWSER_UI_TABS_ORGANIZATION_TRIGGER_H_