| Index: components/previews/core/previews_experiments.h
|
| diff --git a/components/previews/core/previews_experiments.h b/components/previews/core/previews_experiments.h
|
| index ad0bded4a856ee7de386c5c329e28415dd0504a2..0a6f3a6f9a3864cbd5ea96a830600fd63d222f56 100644
|
| --- a/components/previews/core/previews_experiments.h
|
| +++ b/components/previews/core/previews_experiments.h
|
| @@ -5,6 +5,10 @@
|
| #ifndef COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
|
| #define COMPONENTS_PREVIEWS_CORE_PREVIEWS_EXPERIMENTS_H_
|
|
|
| +#include <memory>
|
| +#include <utility>
|
| +#include <vector>
|
| +
|
| #include "base/time/time.h"
|
| #include "net/nqe/effective_connection_type.h"
|
|
|
| @@ -53,9 +57,13 @@ net::EffectiveConnectionType EffectiveConnectionTypeThreshold();
|
| enum class PreviewsType {
|
| NONE = 0,
|
| OFFLINE = 1,
|
| + // Insert new enum values here. Keep values sequential to allow looping
|
| + // from NONE+1 to LAST-1.
|
| LAST = 2,
|
| };
|
|
|
| +typedef std::vector<std::pair<PreviewsType, int>> PreviewsTypeList;
|
| +
|
| // Returns true if any client-side previews experiment is active.
|
| bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
|
|
|
| @@ -63,6 +71,13 @@ bool IsIncludedInClientSidePreviewsExperimentsFieldTrial();
|
| // 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();
|
|
|