| 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" |
| 11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
| 12 #include "base/metrics/field_trial_params.h" |
| 12 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 15 #include "content/common/content_switches_internal.h" | 16 #include "content/common/content_switches_internal.h" |
| 16 #include "content/public/common/content_features.h" | 17 #include "content/public/common/content_features.h" |
| 17 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 18 #include "media/base/media_switches.h" | 19 #include "media/base/media_switches.h" |
| 19 #include "services/device/public/cpp/device_features.h" | 20 #include "services/device/public/cpp/device_features.h" |
| 20 #include "third_party/WebKit/public/platform/WebRuntimeFeatures.h" | 21 #include "third_party/WebKit/public/platform/WebRuntimeFeatures.h" |
| 21 #include "ui/gl/gl_switches.h" | 22 #include "ui/gl/gl_switches.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 WebRuntimeFeatures::EnableFeatureFromString("IdleTimeSpellChecking", true); | 385 WebRuntimeFeatures::EnableFeatureFromString("IdleTimeSpellChecking", true); |
| 385 | 386 |
| 386 if (media::GetEffectiveAutoplayPolicy(command_line) != | 387 if (media::GetEffectiveAutoplayPolicy(command_line) != |
| 387 switches::autoplay::kNoUserGestureRequiredPolicy) { | 388 switches::autoplay::kNoUserGestureRequiredPolicy) { |
| 388 WebRuntimeFeatures::EnableAutoplayMutedVideos(true); | 389 WebRuntimeFeatures::EnableAutoplayMutedVideos(true); |
| 389 } | 390 } |
| 390 | 391 |
| 391 WebRuntimeFeatures::EnableLocationHardReload( | 392 WebRuntimeFeatures::EnableLocationHardReload( |
| 392 base::FeatureList::IsEnabled(features::kLocationHardReload)); | 393 base::FeatureList::IsEnabled(features::kLocationHardReload)); |
| 393 | 394 |
| 395 WebRuntimeFeatures::EnableClientPlaceholdersForServerLoFi( |
| 396 base::GetFieldTrialParamValue("PreviewsClientLoFi", |
| 397 "replace_server_placeholders") == "true"); |
| 398 |
| 394 // Enable explicitly enabled features, and then disable explicitly disabled | 399 // Enable explicitly enabled features, and then disable explicitly disabled |
| 395 // ones. | 400 // ones. |
| 396 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 401 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 397 std::vector<std::string> enabled_features = base::SplitString( | 402 std::vector<std::string> enabled_features = base::SplitString( |
| 398 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 403 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 399 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 404 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 400 for (const std::string& feature : enabled_features) | 405 for (const std::string& feature : enabled_features) |
| 401 WebRuntimeFeatures::EnableFeatureFromString(feature, true); | 406 WebRuntimeFeatures::EnableFeatureFromString(feature, true); |
| 402 } | 407 } |
| 403 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 408 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 404 std::vector<std::string> disabled_features = base::SplitString( | 409 std::vector<std::string> disabled_features = base::SplitString( |
| 405 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 410 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 406 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 411 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 407 for (const std::string& feature : disabled_features) | 412 for (const std::string& feature : disabled_features) |
| 408 WebRuntimeFeatures::EnableFeatureFromString(feature, false); | 413 WebRuntimeFeatures::EnableFeatureFromString(feature, false); |
| 409 } | 414 } |
| 410 } | 415 } |
| 411 | 416 |
| 412 } // namespace content | 417 } // namespace content |
| OLD | NEW |