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