| Index: components/previews/core/previews_experiments.cc
|
| diff --git a/components/previews/core/previews_experiments.cc b/components/previews/core/previews_experiments.cc
|
| index e8d738aa60a6b5fb0c735ab700faf301582065a2..13bc5033913c669e487bbc1315588bf03a7230ce 100644
|
| --- a/components/previews/core/previews_experiments.cc
|
| +++ b/components/previews/core/previews_experiments.cc
|
| @@ -4,8 +4,6 @@
|
|
|
| #include "components/previews/core/previews_experiments.h"
|
|
|
| -#include <string>
|
| -
|
| #include "base/logging.h"
|
| #include "base/metrics/field_trial.h"
|
| #include "base/metrics/field_trial_params.h"
|
| @@ -128,7 +126,7 @@ base::TimeDelta OfflinePreviewFreshnessDuration() {
|
| "offline_preview_freshness_duration_in_days", 7));
|
| }
|
|
|
| -net::EffectiveConnectionType EffectiveConnectionTypeThresholdForOffline() {
|
| +net::EffectiveConnectionType EffectiveConnectionTypeThreshold() {
|
| return GetParamValueAsECT(kClientSidePreviewsFieldTrial,
|
| kEffectiveConnectionTypeThreshold,
|
| net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G);
|
| @@ -152,11 +150,11 @@ bool IsClientLoFiEnabled() {
|
| base::CompareCase::SENSITIVE);
|
| }
|
|
|
| -int ClientLoFiVersion() {
|
| +int LoFiVersion() {
|
| return GetParamValueAsInt(kClientLoFiExperimentName, kVersion, 0);
|
| }
|
|
|
| -net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi() {
|
| +net::EffectiveConnectionType EffectiveConnectionTypeThresholdForLoFi() {
|
| return GetParamValueAsECT(kClientLoFiExperimentName,
|
| kEffectiveConnectionTypeThreshold,
|
| net::EFFECTIVE_CONNECTION_TYPE_2G);
|
| @@ -173,4 +171,20 @@ bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() {
|
| kEnabled, base::CompareCase::SENSITIVE);
|
| }
|
|
|
| +std::string GetStringNameForType(PreviewsType type) {
|
| + switch (type) {
|
| + case PreviewsType::OFFLINE:
|
| + return "Offline";
|
| + case PreviewsType::LOFI:
|
| + return "LoFi";
|
| + case PreviewsType::LITE_PAGE:
|
| + return "LitePage";
|
| + case PreviewsType::NONE:
|
| + case PreviewsType::LAST:
|
| + break;
|
| + }
|
| + NOTREACHED();
|
| + return std::string();
|
| +}
|
| +
|
| } // namespace previews
|
|
|