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
|
// 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.
#include "components/segmentation_platform/embedder/home_modules/tips_manager/constants.h"
namespace segmentation_platform {
// LINT.IfChange(NameForTipIdentifier)
std::string NameForTipIdentifier(TipIdentifier tip) {
switch (tip) {
case TipIdentifier::kUnknown:
return "Unknown";
case TipIdentifier::kLensSearch:
return "LensSearch";
case TipIdentifier::kLensShop:
return "LensShop";
case TipIdentifier::kLensTranslate:
return "LensTranslate";
case TipIdentifier::kAddressBarPosition:
return "AddressBarPosition";
case TipIdentifier::kSavePasswords:
return "SavePasswords";
case TipIdentifier::kAutofillPasswords:
return "AutofillPasswords";
case TipIdentifier::kEnhancedSafeBrowsing:
return "EnhancedSafeBrowsing";
}
}
// LINT.ThenChange(/components/segmentation_platform/embedder/home_modules/tips_manager/constants.h:TipIdentifier)
// LINT.IfChange(TipIdentifierForName)
TipIdentifier TipIdentifierForName(std::string_view name) {
if (name == "Unknown") {
return TipIdentifier::kUnknown;
} else if (name == "LensSearch") {
return TipIdentifier::kLensSearch;
} else if (name == "LensShop") {
return TipIdentifier::kLensShop;
} else if (name == "LensTranslate") {
return TipIdentifier::kLensTranslate;
} else if (name == "AddressBarPosition") {
return TipIdentifier::kAddressBarPosition;
} else if (name == "SavePasswords") {
return TipIdentifier::kSavePasswords;
} else if (name == "AutofillPasswords") {
return TipIdentifier::kAutofillPasswords;
} else if (name == "EnhancedSafeBrowsing") {
return TipIdentifier::kEnhancedSafeBrowsing;
} else {
return TipIdentifier::kUnknown; // Default to unknown if not found.
}
}
// LINT.ThenChange(/components/segmentation_platform/embedder/home_modules/tips_manager/constants.h:TipIdentifier)
// LINT.IfChange(NameForTipPresentationContext)
std::string NameForTipPresentationContext(TipPresentationContext context) {
switch (context) {
case TipPresentationContext::kUnknown:
return "Unknown";
case TipPresentationContext::kIOSMagicStack:
return "IOSMagicStack";
}
}
// LINT.ThenChange(/components/segmentation_platform/embedder/home_modules/tips_manager/constants.h:TipPresentationContext)
constexpr char kFirstObservedTime[] = "first_observed_time";
constexpr char kLastObservedTime[] = "last_observed_time";
constexpr char kTotalOccurrences[] = "total_occurrences";
constexpr char kTipsSignalHistory[] =
"segmentation_platform.tips.signal_history";
const char kAddressBarPositionEphemeralModuleInteractedPref[] =
"ephemeral_pref_interacted."
"address_bar_position_ephemeral_module_interacted";
const char kAutofillPasswordsEphemeralModuleInteractedPref[] =
"ephemeral_pref_interacted."
"autofill_passwords_ephemeral_module_interacted";
const char kEnhancedSafeBrowsingEphemeralModuleInteractedPref[] =
"ephemeral_pref_interacted."
"enhanced_safe_browsing_ephemeral_module_interacted";
const char kSavePasswordsEphemeralModuleInteractedPref[] =
"ephemeral_pref_interacted."
"save_passwords_ephemeral_module_interacted";
const char kLensEphemeralModuleInteractedPref[] =
"ephemeral_pref_interacted.lens_ephemeral_module_interacted";
const char kLensEphemeralModuleSearchVariationInteractedPref[] =
"ephemeral_pref_interacted."
"lens_ephemeral_module_search_variation_interacted";
const char kLensEphemeralModuleShopVariationInteractedPref[] =
"ephemeral_pref_interacted."
"lens_ephemeral_module_shop_variation_interacted";
const char kLensEphemeralModuleTranslateVariationInteractedPref[] =
"ephemeral_pref_interacted."
"lens_ephemeral_module_translate_variation_interacted";
} // namespace segmentation_platform
|