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

Unified Diff: components/previews/core/previews_experiments.cc

Issue 2433793003: Generalize Previews Type code (Closed)
Patch Set: typo Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/previews/core/previews_experiments.cc
diff --git a/components/previews/core/previews_experiments.cc b/components/previews/core/previews_experiments.cc
index afd1fff87f1ee8db5d3751c94b842d02c69d94ed..2dc8e2e3f4fe637c68c398b045051f5da8b304e1 100644
--- a/components/previews/core/previews_experiments.cc
+++ b/components/previews/core/previews_experiments.cc
@@ -103,22 +103,27 @@ base::TimeDelta BlackListDuration() {
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);
}
-bool IsOfflinePreviewsEnabled() {
- return ParamValue(kOfflinePagesSlowNetwork) == kExperimentEnabled;
+bool IsPreviewsTypeEnabled(PreviewsType type) {
+ switch (type) {
+ case PreviewsType::OFFLINE:
+ return ParamValue(kOfflinePagesSlowNetwork) == kExperimentEnabled;
+ default:
+ return false;
tbansal1 2016/10/21 16:17:19 Add NOTREACHED() in default?
+ }
}
bool EnableOfflinePreviewsForTesting() {
std::map<std::string, std::string> params;
params[kOfflinePagesSlowNetwork] = kExperimentEnabled;
return variations::AssociateVariationParams(kClientSidePreviewsFieldTrial,
kEnabled, params) &&
base::FieldTrialList::CreateFieldTrial(kClientSidePreviewsFieldTrial,
kEnabled);
}
« no previous file with comments | « components/previews/core/previews_experiments.h ('k') | components/previews/core/previews_experiments_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698