OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/child/runtime_features.h" | 5 #include "content/child/runtime_features.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 if (command_line.HasSwitch(switches::kDisablePresentationAPI)) | 173 if (command_line.HasSwitch(switches::kDisablePresentationAPI)) |
174 WebRuntimeFeatures::enablePresentationAPI(false); | 174 WebRuntimeFeatures::enablePresentationAPI(false); |
175 | 175 |
176 if (base::FeatureList::IsEnabled(features::kWebFontsIntervention)) { | 176 if (base::FeatureList::IsEnabled(features::kWebFontsIntervention)) { |
177 WebRuntimeFeatures::enableWebFontsIntervention(true); | 177 WebRuntimeFeatures::enableWebFontsIntervention(true); |
178 if (command_line.HasSwitch(switches::kEnableWebFontsInterventionTrigger)) | 178 if (command_line.HasSwitch(switches::kEnableWebFontsInterventionTrigger)) |
179 WebRuntimeFeatures::enableWebFontsInterventionTrigger(true); | 179 WebRuntimeFeatures::enableWebFontsInterventionTrigger(true); |
180 } | 180 } |
181 | 181 |
| 182 if (base::FeatureList::IsEnabled(features::kScrollAnchoring)) |
| 183 WebRuntimeFeatures::enableScrollAnchoring(true); |
| 184 |
182 if (command_line.HasSwitch(switches::kEnableSlimmingPaintV2)) | 185 if (command_line.HasSwitch(switches::kEnableSlimmingPaintV2)) |
183 WebRuntimeFeatures::enableSlimmingPaintV2(true); | 186 WebRuntimeFeatures::enableSlimmingPaintV2(true); |
184 | 187 |
185 // Enable explicitly enabled features, and then disable explicitly disabled | 188 // Enable explicitly enabled features, and then disable explicitly disabled |
186 // ones. | 189 // ones. |
187 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 190 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
188 std::vector<std::string> enabled_features = base::SplitString( | 191 std::vector<std::string> enabled_features = base::SplitString( |
189 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 192 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
190 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 193 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
191 for (const std::string& feature : enabled_features) | 194 for (const std::string& feature : enabled_features) |
192 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 195 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
193 } | 196 } |
194 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 197 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
195 std::vector<std::string> disabled_features = base::SplitString( | 198 std::vector<std::string> disabled_features = base::SplitString( |
196 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 199 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
197 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 200 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
198 for (const std::string& feature : disabled_features) | 201 for (const std::string& feature : disabled_features) |
199 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 202 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
200 } | 203 } |
201 } | 204 } |
202 | 205 |
203 } // namespace content | 206 } // namespace content |
OLD | NEW |