| 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..546457dc95fc2f9750387d86f4dd426664364afd 100644
|
| --- a/components/previews/core/previews_experiments.cc
|
| +++ b/components/previews/core/previews_experiments.cc
|
| @@ -6,11 +6,13 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/feature_list.h"
|
| #include "base/logging.h"
|
| #include "base/metrics/field_trial.h"
|
| #include "base/metrics/field_trial_params.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_util.h"
|
| +#include "components/previews/core/previews_features.h"
|
|
|
| namespace previews {
|
|
|
| @@ -75,6 +77,15 @@ net::EffectiveConnectionType GetParamValueAsECT(
|
| return value;
|
| }
|
|
|
| +bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() {
|
| + // By convention, an experiment in the client-side previews study enables use
|
| + // of at least one client-side previews optimization if its name begins with
|
| + // "Enabled."
|
| + return base::StartsWith(
|
| + base::FieldTrialList::FindFullName(kClientSidePreviewsFieldTrial),
|
| + kEnabled, base::CompareCase::SENSITIVE);
|
| +}
|
| +
|
| } // namespace
|
|
|
| namespace params {
|
| @@ -136,10 +147,11 @@ net::EffectiveConnectionType EffectiveConnectionTypeThresholdForOffline() {
|
|
|
| bool IsOfflinePreviewsEnabled() {
|
| // Check if "show_offline_pages" is set to "true".
|
| - return IsIncludedInClientSidePreviewsExperimentsFieldTrial() &&
|
| - base::GetFieldTrialParamValue(kClientSidePreviewsFieldTrial,
|
| - kOfflinePagesSlowNetwork) ==
|
| - kExperimentEnabled;
|
| + return base::FeatureList::IsEnabled(features::kOfflinePreviews) ||
|
| + (IsIncludedInClientSidePreviewsExperimentsFieldTrial() &&
|
| + base::GetFieldTrialParamValue(kClientSidePreviewsFieldTrial,
|
| + kOfflinePagesSlowNetwork) ==
|
| + kExperimentEnabled);
|
| }
|
|
|
| int OfflinePreviewsVersion() {
|
| @@ -164,13 +176,4 @@ net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi() {
|
|
|
| } // namespace params
|
|
|
| -bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() {
|
| - // By convention, an experiment in the client-side previews study enables use
|
| - // of at least one client-side previews optimization if its name begins with
|
| - // "Enabled."
|
| - return base::StartsWith(
|
| - base::FieldTrialList::FindFullName(kClientSidePreviewsFieldTrial),
|
| - kEnabled, base::CompareCase::SENSITIVE);
|
| -}
|
| -
|
| } // namespace previews
|
|
|