| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 } | 362 } |
| 363 | 363 |
| 364 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo)) | 364 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo)) |
| 365 WebRuntimeFeatures::EnableLoadingWithMojo(true); | 365 WebRuntimeFeatures::EnableLoadingWithMojo(true); |
| 366 | 366 |
| 367 if (!base::FeatureList::IsEnabled(features::kBlockCredentialedSubresources)) { | 367 if (!base::FeatureList::IsEnabled(features::kBlockCredentialedSubresources)) { |
| 368 WebRuntimeFeatures::EnableFeatureFromString("BlockCredentialedSubresources", | 368 WebRuntimeFeatures::EnableFeatureFromString("BlockCredentialedSubresources", |
| 369 false); | 369 false); |
| 370 } | 370 } |
| 371 | 371 |
| 372 #if defined(OS_ANDROID) |
| 373 if (base::FeatureList::IsEnabled(features::kWebNfc)) |
| 374 WebRuntimeFeatures::EnableWebNfc(true); |
| 375 #endif |
| 376 |
| 372 // Enable explicitly enabled features, and then disable explicitly disabled | 377 // Enable explicitly enabled features, and then disable explicitly disabled |
| 373 // ones. | 378 // ones. |
| 374 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 379 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 375 std::vector<std::string> enabled_features = base::SplitString( | 380 std::vector<std::string> enabled_features = base::SplitString( |
| 376 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 381 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 377 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 382 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 378 for (const std::string& feature : enabled_features) | 383 for (const std::string& feature : enabled_features) |
| 379 WebRuntimeFeatures::EnableFeatureFromString(feature, true); | 384 WebRuntimeFeatures::EnableFeatureFromString(feature, true); |
| 380 } | 385 } |
| 381 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 386 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 382 std::vector<std::string> disabled_features = base::SplitString( | 387 std::vector<std::string> disabled_features = base::SplitString( |
| 383 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 388 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 384 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 389 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 385 for (const std::string& feature : disabled_features) | 390 for (const std::string& feature : disabled_features) |
| 386 WebRuntimeFeatures::EnableFeatureFromString(feature, false); | 391 WebRuntimeFeatures::EnableFeatureFromString(feature, false); |
| 387 } | 392 } |
| 388 } | 393 } |
| 389 | 394 |
| 390 } // namespace content | 395 } // namespace content |
| OLD | NEW |