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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 if (base::FeatureList::IsEnabled(features::kScrollAnchoring)) | 174 if (base::FeatureList::IsEnabled(features::kScrollAnchoring)) |
175 WebRuntimeFeatures::enableScrollAnchoring(true); | 175 WebRuntimeFeatures::enableScrollAnchoring(true); |
176 | 176 |
177 if (command_line.HasSwitch(switches::kEnableSlimmingPaintV2)) | 177 if (command_line.HasSwitch(switches::kEnableSlimmingPaintV2)) |
178 WebRuntimeFeatures::enableSlimmingPaintV2(true); | 178 WebRuntimeFeatures::enableSlimmingPaintV2(true); |
179 | 179 |
180 if (base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)) | 180 if (base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)) |
181 WebRuntimeFeatures::enableRenderingPipelineThrottling(true); | 181 WebRuntimeFeatures::enableRenderingPipelineThrottling(true); |
182 | 182 |
| 183 if (command_line.HasSwitch(switches::kEnableMediaDocumentDownloadButton)) |
| 184 WebRuntimeFeatures::enableMediaDocumentDownloadButton(true); |
| 185 |
183 // Enable explicitly enabled features, and then disable explicitly disabled | 186 // Enable explicitly enabled features, and then disable explicitly disabled |
184 // ones. | 187 // ones. |
185 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 188 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
186 std::vector<std::string> enabled_features = base::SplitString( | 189 std::vector<std::string> enabled_features = base::SplitString( |
187 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 190 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
188 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 191 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
189 for (const std::string& feature : enabled_features) | 192 for (const std::string& feature : enabled_features) |
190 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 193 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
191 } | 194 } |
192 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 195 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
193 std::vector<std::string> disabled_features = base::SplitString( | 196 std::vector<std::string> disabled_features = base::SplitString( |
194 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 197 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
195 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 198 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
196 for (const std::string& feature : disabled_features) | 199 for (const std::string& feature : disabled_features) |
197 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 200 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
198 } | 201 } |
199 } | 202 } |
200 | 203 |
201 } // namespace content | 204 } // namespace content |
OLD | NEW |