File: constants.h

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 (116 lines) | stat: -rw-r--r-- 5,407 bytes parent folder | download | duplicates (5)
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
114
115
116
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_SEGMENTATION_PLATFORM_EMBEDDER_HOME_MODULES_CONSTANTS_H_
#define COMPONENTS_SEGMENTATION_PLATFORM_EMBEDDER_HOME_MODULES_CONSTANTS_H_

#include <optional>
#include <string_view>

#include "base/containers/fixed_flat_set.h"

namespace segmentation_platform {
enum class TipIdentifier;
}  // namespace segmentation_platform

namespace segmentation_platform {

// Input Context keys for emphemeral IOS modules.
inline constexpr char kIsNewUser[] = "is_new_user";
inline constexpr char kIsSynced[] = "is_sycned";
inline constexpr char kLacksEnhancedSafeBrowsing[] =
    "lacks_enhanced_safe_browsing";
inline constexpr char kLensAllowedByEnterprisePolicy[] =
    "lens_allowed_by_enterprise_policy";
inline constexpr char kPasswordManagerAllowedByEnterprisePolicy[] =
    "password_manager_allowed_by_enterprise_policy";
inline constexpr char kEnhancedSafeBrowsingAllowedByEnterprisePolicy[] =
    "enhanced_safe_browsing_allowed_by_enterprise_policy";
inline constexpr char kIsPhoneFormFactor[] = "is_phone_form_factor";
inline constexpr char kLensNotUsedRecently[] = "lens_not_used_recently";
inline constexpr char kDidNotSeeAddressBarPositionChoiceScreen[] =
    "did_not_see_address_bar_position_choice_screen";
inline constexpr char kNoSavedPasswords[] = "no_saved_passwords";
inline constexpr char kDidNotUsePasswordAutofill[] =
    "did_not_use_password_autofill";
inline constexpr char kSendTabInfobarReceivedInLastSession[] =
    "send_tab_infobar_received_in_last_session";

// Input Context keys for emphemeral android modules.
const char kIsUserSignedIn[] = "is_user_signed_in";
const char kShouldShowNonRoleManagerDefaultBrowserPromo[] =
    "should_show_non_role_manager_default_browser_promo";
const char kHasDefaultBrowserPromoShownInOtherSurface[] =
    "has_default_browser_promo_shown_in_other_surface";
const char kTabGroupExists[] = "tab_group_exists";
const char kNumberOfTabs[] = "number_of_tabs";
const char kTabGroupPromoShownCount[] = "tab_group_shown_count";
const char kEducationalTipShownCount[] = "educational_tip_shown_count";
const char kSyncedTabGroupExists[] = "synced_tab_group_exists";
const char kTabGroupSyncPromoShownCount[] = "tab_group_sync_shown_count";
const char kCountOfClearingBrowsingData[] = "count_of_clearing_browsing_data";
const char kCountOfClearingBrowsingDataThroughQuickDelete[] =
    "count_of_clearing_browsing_data_through_quick_delete";
const char kQuickDeletePromoShownCount[] = "quick_delete_shown_count";
const char kIsEligibleToHistoryOptIn[] = "is_eligible_to_history_opt_in";
const char kHistorySyncPromoShownCount[] = "history_sync_promo_shown_count";

const char kAuxiliarySearchAvailable[] = "auxiliary_search_available";

// Placeholder output label for segmentation model executor.
inline constexpr char kPlaceholderEphemeralModuleLabel[] = "placeholder_module";

// Labels for emphemeral IOS modules.
inline constexpr char kPriceTrackingNotificationPromo[] =
    "price_tracking_promo";
inline constexpr char kAddressBarPositionEphemeralModule[] =
    "address_bar_position_ephemeral_module";
inline constexpr char kAutofillPasswordsEphemeralModule[] =
    "autofill_passwords_ephemeral_module";
inline constexpr char kEnhancedSafeBrowsingEphemeralModule[] =
    "enhanced_safe_browsing_ephemeral_module";
inline constexpr char kSavePasswordsEphemeralModule[] =
    "save_passwords_ephemeral_module";
inline constexpr char kLensEphemeralModule[] = "lens_ephemeral_module";
inline constexpr char kSendTabNotificationPromo[] = "send_tab_promo";

// Variation labels for emphemeral IOS modules.
// Lens variation labels
inline constexpr char kLensEphemeralModuleSearchVariation[] =
    "lens_ephemeral_module_search_variation";
inline constexpr char kLensEphemeralModuleShopVariation[] =
    "lens_ephemeral_module_shop_variation";
inline constexpr char kLensEphemeralModuleTranslateVariation[] =
    "lens_ephemeral_module_translate_variation";
inline constexpr auto kLensEphemeralModuleVariationLabels =
    base::MakeFixedFlatSet<std::string_view>({
        kLensEphemeralModuleSearchVariation,
        kLensEphemeralModuleShopVariation,
        kLensEphemeralModuleTranslateVariation,
    });

// Labels for emphemeral android modules.
const char kDefaultBrowserPromo[] = "DefaultBrowserPromo";
const char kTabGroupPromo[] = "TabGroupPromo";
const char kTabGroupSyncPromo[] = "TabGroupSyncPromo";
const char kQuickDeletePromo[] = "QuickDeletePromo";
const char kHistorySyncPromo[] = "HistorySyncPromo";

// Commandline ASCII Switch key to indicate that the test module backend ranker
// should be used.
inline constexpr char kEphemeralModuleBackendRankerTestOverride[] =
    "test-ephemeral-module-ranker";

// Returns the `TipIdentifier` corresponding to the given output `label`.
// If the `label` is unknown, returns `TipIdentifier::kUnknown`.
TipIdentifier TipIdentifierForOutputLabel(std::string_view label);

// Returns the `std::string_view` output label corresponding to the given
// `TipIdentifier`. If the `identifier` is unknown, returns `std::nullopt`.
std::optional<std::string_view> OutputLabelForTipIdentifier(
    TipIdentifier identifier);

}  // namespace segmentation_platform

#endif  // COMPONENTS_SEGMENTATION_PLATFORM_EMBEDDER_HOME_MODULES_CONSTANTS_H_