diff options
Diffstat (limited to 'chromium/components/previews/core/previews_experiments.h')
-rw-r--r-- | chromium/components/previews/core/previews_experiments.h | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/chromium/components/previews/core/previews_experiments.h b/chromium/components/previews/core/previews_experiments.h index 0a6f3a6f9a3..7dd7bc2c42c 100644 --- a/chromium/components/previews/core/previews_experiments.h +++ b/chromium/components/previews/core/previews_experiments.h @@ -5,7 +5,6 @@ #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ -#include <memory> #include <utility> #include <vector> @@ -48,18 +47,40 @@ base::TimeDelta SingleOptOutDuration(); // shown as a preview. base::TimeDelta OfflinePreviewFreshnessDuration(); -// The threshold of EffectiveConnectionType above which previews should not be -// served. -net::EffectiveConnectionType EffectiveConnectionTypeThreshold(); +// The threshold of EffectiveConnectionType above which offline previews should +// not be served. +net::EffectiveConnectionType EffectiveConnectionTypeThresholdForOffline(); + +// Whether offline previews are enabled. +bool IsOfflinePreviewsEnabled(); + +// The blacklist version for offline previews. +int OfflinePreviewsVersion(); + +// Whether Client LoFi previews are enabled. +bool IsClientLoFiEnabled(); + +// The blacklist version for Client LoFi previews. +int ClientLoFiVersion(); + +// The threshold of EffectiveConnectionType above which Client LoFi previews +// should not be served. +net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi(); } // namespace params enum class PreviewsType { NONE = 0, + + // The user is shown an offline page as a preview. OFFLINE = 1, + + // Replace images with placeholders generated on the client. + CLIENT_LOFI = 2, + // Insert new enum values here. Keep values sequential to allow looping // from NONE+1 to LAST-1. - LAST = 2, + LAST = 3, }; typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList; @@ -67,21 +88,6 @@ typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList; // Returns true if any client-side previews experiment is active. bool IsIncludedInClientSidePreviewsExperimentsFieldTrial(); -// Returns true if the field trial that should enable previews for |type| for -// prohibitvely slow networks is active. -bool IsPreviewsTypeEnabled(PreviewsType type); - -// Returns the version of preview treatment |type|. Defaults to 0 if not -// specified in field trial config. -int GetPreviewsTypeVersion(PreviewsType type); - -// Returns the enabled PreviewsTypes with their version. -std::unique_ptr<PreviewsTypeList> GetEnabledPreviews(); - -// Sets the appropriate state for field trial and variations to imitate the -// offline pages field trial. -bool EnableOfflinePreviewsForTesting(); - } // namespace previews #endif // COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_ |