Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: components/previews/core/previews_experiments.cc

Issue 2870263004: Add an about:flag to enable client-side LoFi (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/flag_descriptions.cc ('k') | components/previews/core/previews_experiments_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698