File: tpcd_experiment_features.cc

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (113 lines) | stat: -rw-r--r-- 4,697 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// 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[] = "version";
const char kDisable3PCookiesName[] = "disable_3p_cookies";
const char kForceEligibleForTestingName[] = "force_eligible";
const char kDecisionDelayTimeName[] = "decision_delay_time";
const char kNeedOnboardingForSyntheticTrialName[] =
    "need_onboarding_for_synthetic_trial";
const char kNeedOnboardingForLabelName[] = "need_onboarding_for_label";
const char kEnableSilentOnboardingName[] = "enable_silent_onboarding";
const char kExclude3PCBlockedName[] = "exclude_3pc_blocked";
const char kExcludeNotSeenAdsAPIsNoticeName[] = "exclude_has_not_seen_notice";
const char kExcludeDasherAccountName[] = "exclude_dasher_account";
const char kExcludeNewUserName[] = "exclude_new_user";
const char kInstallTimeForNewUserName[] = "install_time_for_new_user";
#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{
    &features::kCookieDeprecationFacilitatedTesting, /*name=*/kVersionName,
    /*default_value=*/0};

// True IFF third-party cookies are disabled.
// Distinguishes between "Mode A" and "Mode B" cohorts.
const base::FeatureParam<bool> kDisable3PCookies{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kDisable3PCookiesName,
    /*default_value=*/false};

const base::FeatureParam<base::TimeDelta> kDecisionDelayTime{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kDecisionDelayTimeName,
    /*default_value=*/base::Seconds(1)};

// 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{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kForceEligibleForTestingName,
    /*default_value=*/false};

// 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{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kNeedOnboardingForSyntheticTrialName,
    /*default_value=*/false};

// Set whether to wait for onboarding to send the label.
const base::FeatureParam<bool> kNeedOnboardingForLabel{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kNeedOnboardingForLabelName,
    /*default_value=*/false};

// 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{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kEnableSilentOnboardingName,
    /*default_value=*/false};

const base::FeatureParam<bool> kExclude3PCBlocked{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kExclude3PCBlockedName,
    /*default_value=*/true};

const base::FeatureParam<bool> kExcludeNotSeenAdsAPIsNotice{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kExcludeNotSeenAdsAPIsNoticeName,
    /*default_value=*/true};

const base::FeatureParam<bool> kExcludeDasherAccount{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kExcludeDasherAccountName,
    /*default_value=*/true};

const base::FeatureParam<bool> kExcludeNewUser{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kExcludeNewUserName,
    /*default_value=*/true};

const base::FeatureParam<base::TimeDelta> kInstallTimeForNewUser{
    &features::kCookieDeprecationFacilitatedTesting,
    /*name=*/kInstallTimeForNewUserName,
    /*default_value=*/base::Days(30)};

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

}  // namespace tpcd::experiment