OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/previews/core/previews_experiments.h" | 5 #include "components/previews/core/previews_experiments.h" |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/field_trial_params.h" | 10 #include "base/metrics/field_trial_params.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 base::GetFieldTrialParamValue(kClientSidePreviewsFieldTrial, | 150 base::GetFieldTrialParamValue(kClientSidePreviewsFieldTrial, |
151 kOfflinePagesSlowNetwork) == | 151 kOfflinePagesSlowNetwork) == |
152 kExperimentEnabled); | 152 kExperimentEnabled); |
153 } | 153 } |
154 | 154 |
155 int OfflinePreviewsVersion() { | 155 int OfflinePreviewsVersion() { |
156 return GetParamValueAsInt(kClientSidePreviewsFieldTrial, kVersion, 0); | 156 return GetParamValueAsInt(kClientSidePreviewsFieldTrial, kVersion, 0); |
157 } | 157 } |
158 | 158 |
159 bool IsClientLoFiEnabled() { | 159 bool IsClientLoFiEnabled() { |
160 return base::StartsWith( | 160 return base::FeatureList::IsEnabled(features::kClientLoFi) || |
161 base::FieldTrialList::FindFullName(kClientLoFiExperimentName), kEnabled, | 161 base::StartsWith( |
162 base::CompareCase::SENSITIVE); | 162 base::FieldTrialList::FindFullName(kClientLoFiExperimentName), |
| 163 kEnabled, base::CompareCase::SENSITIVE); |
163 } | 164 } |
164 | 165 |
165 int ClientLoFiVersion() { | 166 int ClientLoFiVersion() { |
166 return GetParamValueAsInt(kClientLoFiExperimentName, kVersion, 0); | 167 return GetParamValueAsInt(kClientLoFiExperimentName, kVersion, 0); |
167 } | 168 } |
168 | 169 |
169 net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi() { | 170 net::EffectiveConnectionType EffectiveConnectionTypeThresholdForClientLoFi() { |
170 return GetParamValueAsECT(kClientLoFiExperimentName, | 171 return GetParamValueAsECT(kClientLoFiExperimentName, |
171 kEffectiveConnectionTypeThreshold, | 172 kEffectiveConnectionTypeThreshold, |
172 net::EFFECTIVE_CONNECTION_TYPE_2G); | 173 net::EFFECTIVE_CONNECTION_TYPE_2G); |
(...skipping 11 matching lines...) Expand all Loading... |
184 return "LitePage"; | 185 return "LitePage"; |
185 case PreviewsType::NONE: | 186 case PreviewsType::NONE: |
186 case PreviewsType::LAST: | 187 case PreviewsType::LAST: |
187 break; | 188 break; |
188 } | 189 } |
189 NOTREACHED(); | 190 NOTREACHED(); |
190 return std::string(); | 191 return std::string(); |
191 } | 192 } |
192 | 193 |
193 } // namespace previews | 194 } // namespace previews |
OLD | NEW |