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