Chromium Code Reviews| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) | 306 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) |
| 307 WebRuntimeFeatures::enableGamepadExtensions(true); | 307 WebRuntimeFeatures::enableGamepadExtensions(true); |
| 308 | 308 |
| 309 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) | 309 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) |
| 310 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", | 310 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", |
| 311 false); | 311 false); |
| 312 | 312 |
| 313 if (base::FeatureList::IsEnabled(features::kGenericSensor)) | 313 if (base::FeatureList::IsEnabled(features::kGenericSensor)) |
| 314 WebRuntimeFeatures::enableGenericSensor(true); | 314 WebRuntimeFeatures::enableGenericSensor(true); |
| 315 | 315 |
| 316 // Enable features which VrShell depends on. | |
| 317 if (base::FeatureList::IsEnabled(features::kVrShell)){ | |
|
rkaplow
2016/11/02 15:45:50
ws after )
amp
2016/11/02 18:32:03
Done.
| |
| 318 WebRuntimeFeatures::enableGamepadExtensions(true); | |
| 319 WebRuntimeFeatures::enableWebVR(true); | |
| 320 } | |
| 321 | |
| 316 // Enable explicitly enabled features, and then disable explicitly disabled | 322 // Enable explicitly enabled features, and then disable explicitly disabled |
| 317 // ones. | 323 // ones. |
| 318 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 324 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 319 std::vector<std::string> enabled_features = base::SplitString( | 325 std::vector<std::string> enabled_features = base::SplitString( |
| 320 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 326 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 321 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 327 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 322 for (const std::string& feature : enabled_features) | 328 for (const std::string& feature : enabled_features) |
| 323 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 329 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
| 324 } | 330 } |
| 325 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 331 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 326 std::vector<std::string> disabled_features = base::SplitString( | 332 std::vector<std::string> disabled_features = base::SplitString( |
| 327 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 333 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 328 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 334 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 329 for (const std::string& feature : disabled_features) | 335 for (const std::string& feature : disabled_features) |
| 330 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 336 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 331 } | 337 } |
| 332 } | 338 } |
| 333 | 339 |
| 334 } // namespace content | 340 } // namespace content |
| OLD | NEW |