chromium/chrome/browser/tpcd/experiment/tpcd_experiment_features.cc

// 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.

#include "chrome/browser/tpcd/experiment/tpcd_experiment_features.h"

#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/buildflag.h"
#include "components/content_settings/core/common/features.h"
#include "content/public/common/content_features.h"

namespace tpcd::experiment {

const char kVersionName[] =;
const char kDisable3PCookiesName[] =;
const char kForceEligibleForTestingName[] =;
const char kDecisionDelayTimeName[] =;
const char kNeedOnboardingForSyntheticTrialName[] =;
const char kNeedOnboardingForLabelName[] =;
const char kEnableSilentOnboardingName[] =;
const char kExclude3PCBlockedName[] =;
const char kExcludeNotSeenAdsAPIsNoticeName[] =;
const char kExcludeDasherAccountName[] =;
const char kExcludeNewUserName[] =;
const char kInstallTimeForNewUserName[] =;
#if BUILDFLAG(IS_ANDROID)
const char kExcludePwaOrTwaInstalledName[] = "exclude_pwa_or_twa_installed";
#endif

// Set the version of the experiment finch config.
const base::FeatureParam<int> kVersion{};

// True IFF third-party cookies are disabled.
// Distinguishes between "Mode A" and "Mode B" cohorts.
const base::FeatureParam<bool> kDisable3PCookies{};

const base::FeatureParam<base::TimeDelta> kDecisionDelayTime{};

// Set whether to force client being eligible for manual testing. When
// "disable_3p_cookies" feature param is false, this feature param is only
// meaningful when "enable_silent_onboarding" feature param is true.
const base::FeatureParam<bool> kForceEligibleForTesting{};

// Set whether to wait for onboarding to register the synthetic trial. When
// "disable_3p_cookies" feature param is false, this feature param is only
// meaningful when "enable_silent_onboarding" feature param is true.
const base::FeatureParam<bool> kNeedOnboardingForSyntheticTrial{};

// Set whether to wait for onboarding to send the label.
const base::FeatureParam<bool> kNeedOnboardingForLabel{};

// Set whether to enable silent onboarding. Only meaningful when
// "disable_3p_cookies" feature param is false, and should be enabled if
// either "need_onboarding_for_synthetic_trial" or "need_onboarding_for_label"
// feature param is enabled.
const base::FeatureParam<bool> kEnableSilentOnboarding{};

const base::FeatureParam<bool> kExclude3PCBlocked{};

const base::FeatureParam<bool> kExcludeNotSeenAdsAPIsNotice{};

const base::FeatureParam<bool> kExcludeDasherAccount{};

const base::FeatureParam<bool> kExcludeNewUser{};

const base::FeatureParam<base::TimeDelta> kInstallTimeForNewUser{};

#if BUILDFLAG(IS_ANDROID)
const base::FeatureParam<bool> kExcludePwaOrTwaInstalled{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kExcludePwaOrTwaInstalledName,
    /*default_value=*/true};
#endif

const char kTpcdWritePopupCurrentInteractionHeuristicsGrantsName[] =;
const char kTpcdWritePopupPastInteractionHeuristicsGrantsName[] =;
const char kTpcdBackfillPopupHeuristicsGrantsName[] =;
const char kTpcdPopupHeuristicDisableForAdTaggedPopupsName[] =;
const char kTpcdPopupHeuristicEnableForIframeInitiatorName[] =;
const char kTpcdWriteRedirectHeuristicGrantsName[] =;
const char kTpcdRedirectHeuristicRequireABAFlowName[] =;
const char kTpcdRedirectHeuristicRequireCurrentInteractionName[] =;

const base::FeatureParam<base::TimeDelta>
    kTpcdWritePopupCurrentInteractionHeuristicsGrants{};

const base::FeatureParam<base::TimeDelta>
    kTpcdWritePopupPastInteractionHeuristicsGrants{};

const base::FeatureParam<base::TimeDelta> kTpcdBackfillPopupHeuristicsGrants{};

const base::FeatureParam<bool> kTpcdPopupHeuristicDisableForAdTaggedPopups{};

const base::FeatureParam<EnableForIframeTypes>
    kTpcdPopupHeuristicEnableForIframeInitiator{};

const base::FeatureParam<base::TimeDelta> kTpcdWriteRedirectHeuristicGrants{};

const base::FeatureParam<bool> kTpcdRedirectHeuristicRequireABAFlow{};

const base::FeatureParam<bool> kTpcdRedirectHeuristicRequireCurrentInteraction{};

}  // namespace tpcd::experiment