| Index: components/previews/core/previews_experiments.cc
|
| diff --git a/components/previews/core/previews_experiments.cc b/components/previews/core/previews_experiments.cc
|
| index 97ab3e9a0783b0317bd5adf3c015f5acdd9c0685..fc7922cca8a83bf8b79c8419372e9c5761183a63 100644
|
| --- a/components/previews/core/previews_experiments.cc
|
| +++ b/components/previews/core/previews_experiments.cc
|
| @@ -59,6 +59,11 @@ const char kHostIndifferentBlackListDurationInDays[] =
|
| const char kSingleOptOutDurationInSeconds[] =
|
| "single_opt_out_duration_in_seconds";
|
|
|
| +// The amount of time that an offline page is considered fresh enough to be
|
| +// shown as a preview.
|
| +const char kOfflinePreviewFreshnessDurationInDays[] =
|
| + "offline_preview_freshness_duration_in_days";
|
| +
|
| // The string that corresponds to enabled for the variation param experiments.
|
| const char kExperimentEnabled[] = "true";
|
|
|
| @@ -153,6 +158,15 @@ base::TimeDelta SingleOptOutDuration() {
|
| return base::TimeDelta::FromSeconds(duration);
|
| }
|
|
|
| +base::TimeDelta OfflinePreviewFreshnessDuration() {
|
| + std::string param_value = ParamValue(kOfflinePreviewFreshnessDurationInDays);
|
| + int duration;
|
| + if (!base::StringToInt(param_value, &duration)) {
|
| + return base::TimeDelta::FromDays(7);
|
| + }
|
| + return base::TimeDelta::FromDays(duration);
|
| +}
|
| +
|
| } // namespace params
|
|
|
| bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() {
|
|
|