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