Chromium Code Reviews| 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 <string> | 7 #include <string> |
|
tbansal1
2017/05/02 21:49:31
rm this include since this is now in header file.
RyanSturm
2017/05/02 22:57:19
Done.
RyanSturm
2017/05/02 22:57:19
Done.
| |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "base/metrics/field_trial_params.h" | 11 #include "base/metrics/field_trial_params.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 | 14 |
| 15 namespace previews { | 15 namespace previews { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 | 166 |
| 167 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() { | 167 bool IsIncludedInClientSidePreviewsExperimentsFieldTrial() { |
| 168 // By convention, an experiment in the client-side previews study enables use | 168 // By convention, an experiment in the client-side previews study enables use |
| 169 // of at least one client-side previews optimization if its name begins with | 169 // of at least one client-side previews optimization if its name begins with |
| 170 // "Enabled." | 170 // "Enabled." |
| 171 return base::StartsWith( | 171 return base::StartsWith( |
| 172 base::FieldTrialList::FindFullName(kClientSidePreviewsFieldTrial), | 172 base::FieldTrialList::FindFullName(kClientSidePreviewsFieldTrial), |
| 173 kEnabled, base::CompareCase::SENSITIVE); | 173 kEnabled, base::CompareCase::SENSITIVE); |
| 174 } | 174 } |
| 175 | 175 |
| 176 std::string GetStringNameForType(PreviewsType type) { | |
| 177 switch (type) { | |
| 178 case PreviewsType::OFFLINE: | |
| 179 return "Offline"; | |
| 180 case PreviewsType::CLIENT_LOFI: | |
| 181 return "ClientLoFi"; | |
| 182 case PreviewsType::SERVER_LOFI: | |
| 183 return "ServerLoFi"; | |
| 184 case PreviewsType::LITE_PAGE: | |
| 185 return "LitePage"; | |
| 186 case PreviewsType::NONE: | |
| 187 case PreviewsType::LAST: | |
| 188 break; | |
| 189 } | |
| 190 NOTREACHED(); | |
| 191 return std::string(); | |
| 192 } | |
| 193 | |
| 176 } // namespace previews | 194 } // namespace previews |
| OLD | NEW |