| // Copyright 2017 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_SAFE_BROWSING_CORE_COMMON_FEATURES_H_ | |
| #define COMPONENTS_SAFE_BROWSING_CORE_COMMON_FEATURES_H_ | |
| #include <stddef.h> | |
| #include "base/feature_list.h" | |
| #include "base/metrics/field_trial_params.h" | |
| #include "base/time/time.h" | |
| #include "base/values.h" | |
| namespace safe_browsing { | |
| // Features list | |
| // | |
| // These options group together non-empty lines, then sorts by the name | |
| // of the feature in each block. It's recommended to keep all | |
| // FeatureParams for a given Feature in the same group as as the Feature | |
| // declaration. | |
| // | |
| // clang-format off | |
| // keep-sorted start group_end_regex=^$ allow_yaml_lists=yes by_regex=["BASE_DECLARE_FEATURE\\(.*\\);"] skip_lines=2 newline_separated=true sticky_comments=false | |
| // clang-format on | |
| // Controls various parameters related to occasionally collecting ad samples, | |
| // for example to control how often collection should occur. | |
| BASE_DECLARE_FEATURE(kAdSamplerTriggerFeature); | |
| // Enables adding warning shown timestamp to client safe browsing report. | |
| BASE_DECLARE_FEATURE(kAddWarningShownTSToClientSafeBrowsingReport); | |
| // Enables antivirus product info to be included in download pings. | |
| BASE_DECLARE_FEATURE(kAntivirusTelemetryForDownloads); | |
| // Enables automatic revocation of notification permissions after the user has | |
| // received a number of notifications with a suspicious verdict from the | |
| // on-device model. | |
| BASE_DECLARE_FEATURE(kAutoRevokeSuspiciousNotification); | |
| // The number of days in which suspicious notification will be counted toward | |
| // `kAutoRevokeSuspiciousNotificationMinNotificationCount`. | |
| extern const base::FeatureParam<int> | |
| kAutoRevokeSuspiciousNotificationLookBackPeriod; | |
| // Notification permissions with site engagement score of | |
| // kAutoRevokeSuspiciousNotificationEngagementScoreCutOff or higher will not be | |
| // revoked due to suspicious content reason to prevent false positive | |
| // revocations. | |
| extern const base::FeatureParam<double> | |
| kAutoRevokeSuspiciousNotificationEngagementScoreCutOff; | |
| // The minimum number of suspicious notification warning the user have received | |
| // during `kAutoRevokeSuspiciousNotificationLookBackPeriod` before the | |
| // notification permission is revoked. | |
| extern const base::FeatureParam<int> | |
| kAutoRevokeSuspiciousNotificationMinNotificationCount; | |
| // Enables Bundled Security Settings UI on chrome://settings/security. | |
| BASE_DECLARE_FEATURE(kBundledSecuritySettings); | |
| // Enables Ask-Before-HTTP / HTTPS-First Mode integration into the Enhanced | |
| // Security settings bundle. | |
| BASE_DECLARE_FEATURE(kBundledSecuritySettingsAskBeforeHttp); | |
| // Allows a list of ClientSideDetectionType to bypass the priority tier check. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionBypassTiers); | |
| // The tier list below will be in form of the integer value of the | |
| // ClientSideDetectionType which will bypass the system. Example: "1,2" will | |
| // allow trigger type FORCE_REQUEST and TRIGGER_MODELS to bypass all others. | |
| extern const base::FeatureParam<std::string> | |
| kClientSideDetectionBypassTiersList; | |
| // Expand CSPP beyond phishing and trigger when clipboard copy API is called on | |
| // the page. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionClipboardCopyApi); | |
| extern const base::FeatureParam<double> kCsdClipboardCopyApiHCAcceptanceRate; | |
| extern const base::FeatureParam<int> kCsdClipboardCopyApiMaxLength; | |
| extern const base::FeatureParam<int> kCsdClipboardCopyApiMinLength; | |
| extern const base::FeatureParam<double> kCsdClipboardCopyApiSampleRate; | |
| extern const base::FeatureParam<bool> kCSDClipboardCopyApiProcessPayload; | |
| extern const base::FeatureParam<bool> kCSDClipboardCopyApiIncludeFullPayload; | |
| extern const base::FeatureParam<std::string> kCsdClipboardCopyApiLoaders; | |
| extern const base::FeatureParam<std::string> kCsdClipboardCopyApiRunners; | |
| extern const base::FeatureParam<std::string> kCsdClipboardCopyApiRemoteRunners; | |
| extern const base::FeatureParam<std::string> kCsdClipboardCopyApiDecoders; | |
| extern const base::FeatureParam<bool> kCSDClipboardCopyApiSuspiciousTokenFilter; | |
| // Runs client-side phishing visual classification and image embedding in the | |
| // browser process, capturing page pixels via | |
| // `RenderWidgetHostView::CopyFromSurface`, instead of in the renderer process. | |
| // When enabled, the browser process owns the `Scorer` instead of distributing | |
| // the phishing models to renderers. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionCopyFromSurface); | |
| // Maximum time viz may take to produce the page capture before it is treated | |
| // as failed. Zero disables viz's timeout, leaving only the browser-side | |
| // watchdog (this value plus a fixed allowance). | |
| BASE_DECLARE_FEATURE_PARAM(base::TimeDelta, kCsdCopyFromSurfaceTimeout); | |
| // Enables sending a CSD ping on the detection of a credit card form. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionCreditCardForm); | |
| // Sets the high-confidence allowlist acceptance rate for determining whether | |
| // to send a CSD ping triggered by a credit card form. | |
| extern const base::FeatureParam<double> kCsdCreditCardFormHCAcceptanceRate; | |
| // Sets the percentage of credit card forms that trigger a CSD ping. | |
| extern const base::FeatureParam<double> kCsdCreditCardFormSampleRate; | |
| // Sets the maximum site visit count allowed when sending a CSD ping. | |
| // If the user has visited more times than this max, then the CSD ping is | |
| // blocked. | |
| extern const base::FeatureParam<int> kCsdCreditCardFormMaxUserVisit; | |
| // Sets the lookback period in minutes for determining the site visit count. | |
| extern const base::FeatureParam<int> kCsdCreditCardFormUserVisitLookback; | |
| // Specifies whether to filter credit card CSD pings based on whether the user | |
| // is on a new site. | |
| extern const base::FeatureParam<bool> kCsdCreditCardFormEnableNewSiteFilter; | |
| // Specifies whether to filter credit card CSD pings based on what heuristic | |
| // was used to detect the form. | |
| extern const base::FeatureParam<bool> kCsdCreditCardFormEnableHeuristicFilter; | |
| // Specifies whether to filter credit card CSD pings based on the referring app. | |
| extern const base::FeatureParam<bool> | |
| kCsdCreditCardFormEnableReferringAppFilter; | |
| // Specifies whether to enable triggering on interaction with a credit card | |
| // form field. | |
| extern const base::FeatureParam<bool> | |
| kCsdCreditCardFormEnableInteractionTrigger; | |
| // Specifies whether to enable triggering on detection of a credit card form. | |
| extern const base::FeatureParam<bool> kCsdCreditCardFormEnableDetectionTrigger; | |
| // Enables the creation of the ClientSideDetectionService on iOS. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionEnabledIos); | |
| // Specifies whether to enforce on CSD verdicts on iOS by showing a blocking | |
| // page. | |
| extern const base::FeatureParam<bool> kCsdEnforceIos; | |
| // Killswitch for Llama forced trigger info redirect chain check. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionForcedLlamaRedirectChainKillswitch); | |
| // Includes inner text from cross-origin and out-of-process iframes during | |
| // client-side detection intelligent scans. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionIframeInnerText); | |
| extern const base::FeatureParam<int> kClientSideDetectionMaxIframesToExtract; | |
| extern const base::FeatureParam<base::TimeDelta> | |
| kClientSideDetectionIframeInnerTextTimeout; | |
| // Enables sending a CSD ping when a page's image embedding matches a | |
| // target image embedding. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionImageEmbeddingMatch); | |
| // Specifies whether to trigger the intelligent scan along with the image | |
| // embedding match. | |
| extern const base::FeatureParam<bool> | |
| kCsdImageEmbeddingMatchWithIntelligentScan; | |
| // Prepends the page title to the extracted inner text sent during client-side | |
| // detection intelligent scans. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionIncludeTitleInInnerText); | |
| // Delays and retries KEYBOARD_LOCK_REQUESTED image embedding when the blurred | |
| // viewport image is uniform (e.g. blank white or black). | |
| BASE_DECLARE_FEATURE(kClientSideDetectionKeyboardLockUniformPageDelay); | |
| extern const base::FeatureParam<int> kCsdKeyboardLockUniformPageDelayDurationMs; | |
| extern const base::FeatureParam<int> kCsdKeyboardLockUniformPageMaxRetries; | |
| extern const base::FeatureParam<int> kCsdKeyboardLockUniformPageMaxColorRange; | |
| // Killswitch for client side phishing detection. Since client side models are | |
| // run on a large fraction of navigations, crashes due to the model are very | |
| // impactful, even if only a small fraction of users have a bad version of the | |
| // model. This Finch flag allows us to remediate long-tail component versions | |
| // while we fix the root cause. This will also halt the model distribution from | |
| // OptimizationGuide. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionKillswitch); | |
| // Tweak the way local resource check is done in CSD preclassification check. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionLocalResourceCheckFix); | |
| // The observers that trigger the image classification have been tweaked with a | |
| // more defined page loading state check. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionNewObservers); | |
| extern const base::FeatureParam<double> kCsdClassificationDelay; | |
| // Deprecation of page load triggers for SSB users. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionOnlyESBClassification); | |
| // Killswitch for force request redirect chain check. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionRedirectChainKillswitch); | |
| BASE_DECLARE_FEATURE(kClientSideDetectionRetryLimit); | |
| extern const base::FeatureParam<int> kClientSideDetectionRetryLimitTime; | |
| // Controls whether the URL is included in ScamDetectionRequest for | |
| // intelligent scan. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionScamDetectionRequestWithUrl); | |
| // Controls whether the scam score is included in IntelligentScanInfo. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionScamScore); | |
| // Sends a second delayed FORCE_REQUEST ping if the first FORCE_REQUEST | |
| // verdict is safe. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionSecondForceRequestWithDelay); | |
| extern const base::FeatureParam<int> kCsdForceRequestDelayMs; | |
| #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) | |
| // Inquire the server-side model instead of the on-device model for scam | |
| // detection on Desktop. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionServerModelForScamDetectionDesktop); | |
| extern const base::FeatureParam<int> | |
| kClientSideDetectionServerModelMaxScansPerDayDesktop; | |
| #endif | |
| #if BUILDFLAG(IS_IOS) | |
| // Controls whether scam detection via the server-side model is enabled on iOS. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionServerModelForScamDetectionIos); | |
| extern const base::FeatureParam<int> | |
| kClientSideDetectionServerModelMaxScansPerDayIos; | |
| #endif | |
| // Controls whether screenshots are captured and sent to the server-side model | |
| // for scam detection. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionServerModelMultimodal); | |
| // Controls whether low-end devices are excluded from capturing screenshots for | |
| // multimodal scam detection. | |
| extern const base::FeatureParam<bool> | |
| kClientSideDetectionServerModelMultimodalExcludeLowEndDevices; | |
| // Maximum size in bytes of the captured PNG screenshot to attach to a | |
| // multimodal intelligent scan request. A negative value disables the size | |
| // limit. | |
| extern const base::FeatureParam<int> | |
| kClientSideDetectionServerModelMultimodalMaxScreenshotBytes; | |
| // Timeout for capturing a viewport screenshot for multimodal scam detection | |
| // via CopyFromSurface. A non-positive value disables the timeout. | |
| extern const base::FeatureParam<base::TimeDelta> | |
| kClientSideDetectionServerModelMultimodalCopyFromSurfaceTimeout; | |
| #if BUILDFLAG(IS_ANDROID) | |
| // Dedicated long-lived feature flag to control future server model rollout and | |
| // set the model version. This flag should not be cleaned up after the server | |
| // model is launched. See go/mes-config-rollouts#roll-out-via-finch on the | |
| // recommended way to control rollouts. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionServerModelRolloutAndroid); | |
| // Note for future finch config: Set an arbitrary integer value associated with | |
| // the model version (e.g. 1001). Update go/slams-mapping accordingly. | |
| extern const base::FeatureParam<int> | |
| kClientSideDetectionServerModelRolloutVersionAndroid; | |
| #endif | |
| #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) | |
| // Dedicated long-lived feature flag to control future server model rollout and | |
| // set the model version for Desktop. This flag should not be cleaned up after | |
| // the server model is launched. See go/mes-config-rollouts#roll-out-via-finch | |
| // on the recommended way to control rollouts. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionServerModelRolloutDesktop); | |
| // Note for future finch config: Set an arbitrary integer value associated with | |
| // the model version (e.g. 1001). Update go/slams-mapping accordingly. | |
| extern const base::FeatureParam<int> | |
| kClientSideDetectionServerModelRolloutVersionDesktop; | |
| #endif | |
| #if BUILDFLAG(IS_IOS) | |
| // Dedicated long-lived feature flag to control future server model rollout and | |
| // set the model version for iOS. This flag should not be cleaned up after | |
| // the server model is launched. See go/mes-config-rollouts#roll-out-via-finch | |
| // on the recommended way to control rollouts. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionServerModelRolloutIos); | |
| // Note for future finch config: Set an arbitrary integer value associated with | |
| // the model version (e.g. 1001). Update go/slams-mapping accordingly. | |
| extern const base::FeatureParam<int> | |
| kClientSideDetectionServerModelRolloutVersionIos; | |
| #endif | |
| BASE_DECLARE_FEATURE(kClientSideDetectionSkipErrorPage); | |
| BASE_DECLARE_FEATURE(kClientSideDetectionTierSystem); | |
| // Enables showing the trick-to-bill (billing) interstitial when the | |
| // intelligent scan returns a SCAM_EXPERIMENT_VERDICT_BILLING verdict. | |
| BASE_DECLARE_FEATURE(kClientSideDetectionTrickToBill); | |
| // Set a RESIZE_BEST preference for image resizing algorithm in Client Side | |
| // Detection renderer processes for both image classification and image | |
| // embedding. This experiment is done to see if the resizing algorithm | |
| // preference will send clearer screenshots for server side evaluation. | |
| BASE_DECLARE_FEATURE(kConditionalImageResize); | |
| // Creates and sends CSBRRs when notification permissions are accepted for an | |
| // abusive site whose interstitial has been bypassed. | |
| BASE_DECLARE_FEATURE(kCreateNotificationsAcceptedClientSafeBrowsingReports); | |
| // Creates and sends CSBRRs when warnings are first shown to users. | |
| BASE_DECLARE_FEATURE(kCreateWarningShownClientSafeBrowsingReports); | |
| // Controls whether the delayed warning experiment is enabled. | |
| BASE_DECLARE_FEATURE(kDelayedWarnings); | |
| // True if mouse clicks should undelay the warnings immediately when delayed | |
| // warnings feature is enabled. | |
| extern const base::FeatureParam<bool> kDelayedWarningsEnableMouseClicks; | |
| // Sends the WebProtect content scanning request to the corresponding regional | |
| // DLP endpoint based on ChromeDataRegionSetting policy. | |
| BASE_DECLARE_FEATURE(kDlpRegionalizedEndpoints); | |
| // Enables HaTS surveys for users encountering desktop download warnings on the | |
| // download bubble or the downloads page. | |
| BASE_DECLARE_FEATURE(kDownloadWarningSurvey); | |
| // The time interval after which to consider a download warning ignored, and | |
| // potentially show the survey for ignoring a download bubble warning. | |
| extern const base::FeatureParam<int> kDownloadWarningSurveyIgnoreDelaySeconds; | |
| // Gives the type of the download warning HaTS survey that the user is eligible | |
| // for. This should be set in the fieldtrial config along with the trigger ID | |
| // for the corresponding survey (as en_site_id). The int value corresponds to | |
| // the value of DownloadWarningHatsType enum (see | |
| // //c/b/download/download_warning_desktop_hats_util.h). | |
| extern const base::FeatureParam<int> kDownloadWarningSurveyType; | |
| // When enabled, behaves the same as | |
| // kMigrateToBlockV8OptimizerOnUnfamiliarSites, but only targeting profiles | |
| // that have Safe Browsing Enhanced Protection enabled. | |
| BASE_DECLARE_FEATURE(kEnableBlockV8OptimizerOnUnfamiliarSitesForEsbClients); | |
| BASE_DECLARE_FEATURE_PARAM(bool, kEsbDryRun); | |
| BASE_DECLARE_FEATURE_PARAM(int, kEsbMinSiteEngagementScore); | |
| BASE_DECLARE_FEATURE_PARAM(base::TimeDelta, kEsbMinAgeOfInitialVisit); | |
| // Enabled additional device and network information to RealTimeUrlCheck | |
| // requests, WP scan requests, and reporting events. These will be visible from | |
| // the chrome://safe-browsing page. | |
| BASE_DECLARE_FEATURE(kEnhancedFieldsForSecOps); | |
| // Enables Enhanced Safe Browsing promos for iOS. | |
| BASE_DECLARE_FEATURE(kEnhancedSafeBrowsingPromo); | |
| // Adds support for enterprise deep scans initiated through the file system | |
| // access API. | |
| BASE_DECLARE_FEATURE(kEnterpriseFileSystemAccessDeepScan); | |
| // Enables showing an updated Password Reuse UI for enterprise users. | |
| BASE_DECLARE_FEATURE(kEnterprisePasswordReuseUiRefresh); | |
| // Use a new URL for the enterprise real-time URL check. | |
| BASE_DECLARE_FEATURE(kEnterpriseRealTimeUrlCheckNewUrl); | |
| // Skips enterprise real-time URL lookups for URLs in | |
| // `ChromeEnterpriseRealTimeUrlLookupService::CanCheckUrl` (about:blank on | |
| // Android, chrome-native://newtab/ and the search warmup URL). | |
| BASE_DECLARE_FEATURE(kEnterpriseRealTimeUrlCheckUrlSkiplist); | |
| // Makes the Enhanced Protection a syncable setting. | |
| // Check the design doc (go/esb-as-a-synced-setting-dd) for further details. | |
| BASE_DECLARE_FEATURE(kEsbAsASyncedSetting); | |
| // Controls whether Safe Browsing Extended Reporting (SBER) is deprecated. | |
| // When this feature flag is enabled: | |
| // - the Extended Reporting toggle will not be displayed on | |
| // chrome://settings/security | |
| // - features will not depend on the SBER preference value, | |
| // safebrowsing.scout_reporting_enabled | |
| BASE_DECLARE_FEATURE(kExtendedReportingRemovePrefDependency); | |
| // Bypasses the Safe Browsing network query for extensions blocklist checks | |
| // because a subsequent check will retrieve the blocklist state. | |
| BASE_DECLARE_FEATURE(kExtensionBlocklistSkipNetworkQuery); | |
| // Allows the Extension Telemetry Service to accept and use configurations | |
| // sent by the server. | |
| BASE_DECLARE_FEATURE(kExtensionTelemetryConfiguration); | |
| // Reduces the extension telemetry service's enterprise telemetry reporting | |
| // interval to 30 seconds. | |
| BASE_DECLARE_FEATURE(kExtensionTelemetryEnterpriseShortReportingInterval); | |
| // Enables the search hijacking signal in extension telemetry. | |
| BASE_DECLARE_FEATURE(kExtensionTelemetrySearchHijackingSignal); | |
| // The default interval between heuristic checks. | |
| extern const base::FeatureParam<int> | |
| kExtensionTelemetrySearchHijackingSignalHeuristicCheckIntervalSeconds; | |
| // The default threshold value (omnibox searches - SERP landings) that | |
| // results in a heuristic match. | |
| extern const base::FeatureParam<int> | |
| kExtensionTelemetrySearchHijackingSignalHeuristicThreshold; | |
| // Enables querying server-side Gemini model for scam detection. | |
| BASE_DECLARE_FEATURE(kGeminiAntiscamProtectionForMetricsCollection); | |
| // The minimum scam score required to log page content to MQLS. | |
| extern const base::FeatureParam<double> | |
| kGeminiAntiscamProtectionMinScamScoreLogPageContent; | |
| // Replace the high confidence allowlist check gating notification warnings with | |
| // a check of the global cache list specific to safe notification sites. | |
| BASE_DECLARE_FEATURE(kGlobalCacheListForGatingNotificationProtections); | |
| // Whether to provide Google Play Protect status in APK telemetry pings | |
| BASE_DECLARE_FEATURE(kGooglePlayProtectInApkTelemetry); | |
| // Whether Google Play Protect should supercede file-type warnings | |
| BASE_DECLARE_FEATURE(kGooglePlayProtectReducesWarnings); | |
| // Communicated to the server to determine DBSC on google.com. This | |
| // allows us to slice metrics by google.com DBSC state without any | |
| // Google-specific code in the net stack. | |
| BASE_DECLARE_FEATURE(kGoogleStandardDeviceBoundSessionCredentials); | |
| // Sends hash-prefix real-time lookup requests on navigations for Standard Safe | |
| // Browsing users instead of hash-prefix database lookups. | |
| // Note: This feature flag should not be cleaned up even though the feature has | |
| // launched. This is kept as a killswitch because it controls whether we try to | |
| // use the third-party dependency set by `kHashPrefixRealTimeLookupsRelayUrl`. | |
| BASE_DECLARE_FEATURE(kHashPrefixRealTimeLookups); | |
| // This parameter controls the relay URL that will forward the lookup requests | |
| // to the Safe Browsing server. | |
| extern const base::FeatureParam<std::string> kHashPrefixRealTimeLookupsRelayUrl; | |
| // This parameter controls the key fetch URL that will be used to fetch the HPKE | |
| // key that will be used to encrypt the lookup requests. | |
| extern const base::FeatureParam<std::string> | |
| kHashPrefixRealTimeLookupsKeyFetchUrl; | |
| // This parameter controls the header used to request a given HPKE key type. | |
| extern const base::FeatureParam<std::string> | |
| kHashPrefixRealTimeLookupsKeyFetchKeyTypeHeader; | |
| // This parameter allows adding a custom header to the HPKE key fetch request. | |
| extern const base::FeatureParam<std::string> | |
| kHashPrefixRealTimeLookupsKeyFetchCustomHeader; | |
| // Killswitch for enabling OhttpKeyService for Enhanced Safe Browsing users | |
| // regardless of whether background lookups are allowed (e.g. on iOS). | |
| BASE_DECLARE_FEATURE(kHashPrefixRealTimeLookupsOhttpKeyServiceForEsb); | |
| // Enables hash-prefix real-time lookup requests on Incognito and Guest mode. | |
| BASE_DECLARE_FEATURE(kHashPrefixRealTimeLookupsOnIncognitoAndGuest); | |
| // Send sample hash-prefix real-time lookups for real-time lookups to catch | |
| // "false positives" where real-time lookup says safe but hash-prefix lookup | |
| // says unsafe. | |
| // Check the design doc (go/sample-esb-ping-send-hprt) for further | |
| // details. | |
| BASE_DECLARE_FEATURE(kHashPrefixRealTimeLookupsSamplePing); | |
| // Determines the percentage of ESB lookups that we sample to send a background | |
| // HPRT lookup. The value should be between 0 and 100. | |
| extern const base::FeatureParam<int> kHashPrefixRealTimeLookupsSampleRate; | |
| // If enabled, fetching lists from Safe Browsing and performing checks on those | |
| // lists uses the v5 APIs instead of the v4 Update API. There is no change to | |
| // how often the checks are triggered (they are still not in real time). | |
| BASE_DECLARE_FEATURE(kLocalListsUseSBv5); | |
| #if BUILDFLAG(IS_ANDROID) | |
| // Enables ClientDownloadRequests for APK downloads on Android. | |
| BASE_DECLARE_FEATURE(kMaliciousApkDownloadCheck); | |
| // Sampling percentage for ClientDownloadRequests for APK downloads on Android. | |
| // If this parameter is N, then a given (supported) download has a N% chance of | |
| // sending a ClientDownloadRequest. The value should be between 0 and 100, and | |
| // defaults to 100 (i.e. no downsampling). | |
| BASE_DECLARE_FEATURE_PARAM(int, kMaliciousApkDownloadCheckSamplePercentage); | |
| // Allows a fieldtrial config to override the APK download check service URL. If | |
| // empty (default), the default hardcoded URL will be used. | |
| extern const base::FeatureParam<std::string> | |
| kMaliciousApkDownloadCheckServiceUrlOverride; | |
| // If true, then ClientDownloadRequests for APK downloads on Android are | |
| // telemetry-only, and only for Enhanced Protection users. If false (default), | |
| // then ClientDownloadRequests for APK downloads on Android are active for all | |
| // Safe Browsing-enabled users, and may show warnings. | |
| BASE_DECLARE_FEATURE_PARAM(bool, kMaliciousApkDownloadCheckTelemetryOnly); | |
| #endif | |
| // When enabled, performs a one-time migration that selects the JavaScript | |
| // optimizer content setting that automatically blocks the browser from using | |
| // JavaScript optimizers on unfamiliar sites. Only profiles that have Safe | |
| // Browsing enabled, have the JavaScript optimizer set to allowed for all sites, | |
| // and have the kBlockV8OptimizerOnUnfamiliarSitesSetting feature enabled will | |
| // be eligible for the migration. | |
| BASE_DECLARE_FEATURE(kMigrateToBlockV8OptimizerOnUnfamiliarSites); | |
| BASE_DECLARE_FEATURE_PARAM( | |
| int, | |
| kMigrateToBlockV8OptimizerOnUnfamiliarSitesMinSiteEngagementScore); | |
| BASE_DECLARE_FEATURE_PARAM( | |
| base::TimeDelta, | |
| kMigrateToBlockV8OptimizerOnUnfamiliarSitesMinAgeOfInitialVisit); | |
| // If true, the migration will run in dry-run mode (evaluating eligibility and | |
| // logging metrics, but not actually changing the content setting). | |
| BASE_DECLARE_FEATURE_PARAM(bool, | |
| kMigrateToBlockV8OptimizerOnUnfamiliarSitesDryRun); | |
| // Enables the notice queue integration for the ESB notice. | |
| BASE_DECLARE_FEATURE(kNoticeQueueForEsb); | |
| // Enable the collection of Notification Telemetry to track potentially abusive | |
| // notifications. | |
| BASE_DECLARE_FEATURE(kNotificationTelemetry); | |
| // Routes synchronous navigation SafeBrowsing database lookup replies onto the | |
| // high-priority kNavigationNetworkResponse UI task runner. | |
| BASE_DECLARE_FEATURE(kPrioritizeSafeBrowsingNavigationCallbacks); | |
| // Enables proactive password protection, which triggers a CSD scan when | |
| // focusing on a password field. | |
| BASE_DECLARE_FEATURE(kProactivePasswordProtection); | |
| extern const base::FeatureParam<double> | |
| kCsdProactivePasswordProtectionSampleRate; | |
| // Enables HaTS surveys for users encountering red warnings. | |
| BASE_DECLARE_FEATURE(kRedWarningSurvey); | |
| // Specifies whether we want to show HaTS surveys based on if the user bypassed | |
| // the warning or not. Note: specifying any combination of TRUE and FALSE | |
| // corresponds to "don't care." | |
| extern const base::FeatureParam<std::string> kRedWarningSurveyDidProceedFilter; | |
| // Specifies which CSBRR report types (and thus, red warning types) we want to | |
| // show HaTS surveys for. | |
| extern const base::FeatureParam<std::string> kRedWarningSurveyReportTypeFilter; | |
| // Specifies the HaTS survey's identifier. | |
| extern const base::FeatureParam<std::string> kRedWarningSurveyTriggerId; | |
| // Enables HaTS surveys for Android users encountering red warnings. | |
| BASE_DECLARE_FEATURE(kRedWarningSurveyAndroid); | |
| // Specifies the HaTS survey trigger ID for general Android red warnings. | |
| extern const base::FeatureParam<std::string> kRedWarningSurveyAndroidTriggerId; | |
| // Specifies the HaTS survey trigger ID for Android red warnings when the user | |
| // proceeded past the warning. | |
| extern const base::FeatureParam<std::string> | |
| kRedWarningSurveyAndroidProceedTriggerId; | |
| // Specifies the HaTS survey trigger ID for Android red warnings when the user | |
| // heeded the warning (did not proceed). | |
| extern const base::FeatureParam<std::string> | |
| kRedWarningSurveyAndroidHeedTriggerId; | |
| // If enabled, advanced protection program users are shown relaunch to apply | |
| // update required. | |
| BASE_DECLARE_FEATURE(kRelaunchNotificationForAdvancedProtection); | |
| // Enables reporting notification contents and metadata to the server, upon user | |
| // consent. | |
| BASE_DECLARE_FEATURE(kReportNotificationContentDetectionData); | |
| // Determines how often we should log the reported notification to the server. | |
| // For the default rate of 100, the notification will always be reported where a | |
| // rate of 0 means there is no reporting. This will help limit data volume, if | |
| // it becomes excessive. | |
| extern const base::FeatureParam<int> | |
| kReportNotificationContentDetectionDataRate; | |
| // Enables the Rust implementation of mojom::PhishingModelSetter in the | |
| // renderer process. | |
| BASE_DECLARE_FEATURE(kRustPhishingModelSetter); | |
| // Enables client side phishing daily reports limit to be configured via Finch | |
| // for ESB and SBER users | |
| BASE_DECLARE_FEATURE(kSafeBrowsingDailyPhishingReportsLimit); | |
| // Specifies the CSD-Phishing daily reports limit for ESB users | |
| extern const base::FeatureParam<int> kSafeBrowsingDailyPhishingReportsLimitESB; | |
| // Enables automatic cleanup of unrecognized or deprecated Safe Browsing stores | |
| // and stale hash files on disk during database startup. | |
| BASE_DECLARE_FEATURE(kSafeBrowsingDeleteUnusedStores); | |
| // Suppresses dangerous file warnings when Safe Browsing is in No Protection | |
| // mode. | |
| BASE_DECLARE_FEATURE(kSafeBrowsingNoProtectionSuppressWarnings); | |
| // Enables temporary (24-hour) Safe Browsing opt-out by default. | |
| BASE_DECLARE_FEATURE(kSafeBrowsingNoProtectionTemporary); | |
| // Specifies the temporary No Protection reversion duration in seconds. | |
| extern const base::FeatureParam<int> | |
| kSafeBrowsingNoProtectionTemporaryDurationInSeconds; | |
| // Uses the Rust implementation of the macOS DMG (UDIF/HFS+) parser in place of | |
| // the C++ implementation. | |
| BASE_DECLARE_FEATURE(kSafeBrowsingRustDmgParser); | |
| // Allows Safe Browsing Real-Time URL lookups to wait for DNS resolution of the | |
| // main frame URL. | |
| BASE_DECLARE_FEATURE(kSafeBrowsingWaitForDnsForRealTimeLookup); | |
| // Specifies the timeout duration when waiting for DNS resolution for | |
| // Real-Time URL lookups. | |
| BASE_DECLARE_FEATURE_PARAM(base::TimeDelta, kSafeBrowsingWaitForDnsTimeout); | |
| // Enables saving gaia password hash from the Profile Picker sign-in flow. | |
| BASE_DECLARE_FEATURE(kSavePasswordHashFromProfilePicker); | |
| // Enables showing manual notification auto-revocations in Safety Hub, allowing | |
| // users to review and manage the revoked permissions. | |
| BASE_DECLARE_FEATURE(kShowManualNotificationRevocationsSafetyHub); | |
| // Controls whether the checked URLs are displayed for V5 GetHash lookups on | |
| // the chrome://safe-browsing debugging page. | |
| // TODO(crbug.com/564637472): enabling this is blocked on making the debugging | |
| // page chrome://safe-browsing be profile-specific to avoid regressing privacy. | |
| BASE_DECLARE_FEATURE(kShowUrlsInV5GetHashLookupsWebUI); | |
| // Enables replacing notification contents with a Chrome warning when the | |
| // on-device model returns a sufficiently suspicious verdict. | |
| BASE_DECLARE_FEATURE(kShowWarningsForSuspiciousNotifications); | |
| // Determines the minimum "suspicious" score returned from the notification | |
| // content LiteRT model that warrants showing a warning. If the score is higher | |
| // than this threshold, then the notification contents will be replaced with a | |
| // warning. By default, no notifications will be replaced by a warning. | |
| extern const base::FeatureParam<int> | |
| kShowWarningsForSuspiciousNotificationsScoreThreshold; | |
| // The default button order when showing notification warnings is that the | |
| // "Show notification" and "Always allow" buttons are secondary buttons and | |
| // "Unsubscribe" is the primary button. If this parameter is true, the order of | |
| // the buttons should be swapped where "Unsubscribe" is the secondary button. | |
| extern const base::FeatureParam<bool> | |
| kShowWarningsForSuspiciousNotificationsShouldSwapButtons; | |
| // Controls whether to skip image classification scoring for non-page load | |
| // triggers. | |
| BASE_DECLARE_FEATURE(kSkipImageClassificationScoringForNonPageLoadTriggers); | |
| // Controls the daily quota for the suspicious site trigger. | |
| BASE_DECLARE_FEATURE(kSuspiciousSiteTriggerQuotaFeature); | |
| // Enables HaTS surveys for users encountering suspicious site warnings. | |
| BASE_DECLARE_FEATURE(kSuspiciousSiteWarningSurvey); | |
| extern const base::FeatureParam<std::string> | |
| kSuspiciousSiteWarningSurveyTriggerId; | |
| extern const base::FeatureParam<std::string> | |
| kSuspiciousSiteWarningSurveyProceedTriggerId; | |
| extern const base::FeatureParam<std::string> | |
| kSuspiciousSiteWarningSurveyHeedTriggerId; | |
| // Enables warnings on sites that Safe Browsing deems suspicious. | |
| BASE_DECLARE_FEATURE(kSuspiciousSiteWarnings); | |
| // Controls whether the integration of tailored security settings is enabled. | |
| BASE_DECLARE_FEATURE(kTailoredSecurityIntegration); | |
| // Specifies which non-resource HTML Elements to collect based on their tag and | |
| // attributes. It's a single param containing a comma-separated list of pairs. | |
| // For example: "tag1,id,tag1,height,tag2,foo" - this will collect elements with | |
| // tag "tag1" that have attribute "id" or "height" set, and elements of tag | |
| // "tag2" if they have attribute "foo" set. All tag names and attributes should | |
| // be lower case. | |
| BASE_DECLARE_FEATURE(kThreatDomDetailsTagAndAttributeFeature); | |
| // Controls the behavior of visual features in CSD pings. This feature is | |
| // checked for the final size of the visual features and the minimum size of | |
| // the screen. | |
| BASE_DECLARE_FEATURE(kVisualFeaturesSizes); | |
| // keep-sorted end | |
| base::ListValue GetFeatureStatusList(); | |
| } // namespace safe_browsing | |
| #endif // COMPONENTS_SAFE_BROWSING_CORE_COMMON_FEATURES_H_ |