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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true); | 271 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true); |
272 | 272 |
273 #if defined(OS_ANDROID) | 273 #if defined(OS_ANDROID) |
274 WebRuntimeFeatures::enablePaymentRequest( | 274 WebRuntimeFeatures::enablePaymentRequest( |
275 base::FeatureList::IsEnabled(features::kWebPayments)); | 275 base::FeatureList::IsEnabled(features::kWebPayments)); |
276 #endif | 276 #endif |
277 | 277 |
278 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) | 278 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) |
279 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); | 279 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); |
280 | 280 |
| 281 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) |
| 282 WebRuntimeFeatures::enableGamepadExtensions(true); |
| 283 |
281 // Enable explicitly enabled features, and then disable explicitly disabled | 284 // Enable explicitly enabled features, and then disable explicitly disabled |
282 // ones. | 285 // ones. |
283 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 286 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
284 std::vector<std::string> enabled_features = base::SplitString( | 287 std::vector<std::string> enabled_features = base::SplitString( |
285 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 288 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
286 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 289 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
287 for (const std::string& feature : enabled_features) | 290 for (const std::string& feature : enabled_features) |
288 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 291 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
289 } | 292 } |
290 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 293 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
291 std::vector<std::string> disabled_features = base::SplitString( | 294 std::vector<std::string> disabled_features = base::SplitString( |
292 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 295 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
293 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 296 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
294 for (const std::string& feature : disabled_features) | 297 for (const std::string& feature : disabled_features) |
295 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 298 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
296 } | 299 } |
297 } | 300 } |
298 | 301 |
299 } // namespace content | 302 } // namespace content |
OLD | NEW |