| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( | 59 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( |
| 60 const base::CommandLine& command_line) { | 60 const base::CommandLine& command_line) { |
| 61 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) | 61 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) |
| 62 WebRuntimeFeatures::enableExperimentalFeatures(true); | 62 WebRuntimeFeatures::enableExperimentalFeatures(true); |
| 63 | 63 |
| 64 WebRuntimeFeatures::enableOriginTrials( | 64 WebRuntimeFeatures::enableOriginTrials( |
| 65 base::FeatureList::IsEnabled(features::kOriginTrials)); | 65 base::FeatureList::IsEnabled(features::kOriginTrials)); |
| 66 | 66 |
| 67 WebRuntimeFeatures::enableFeaturePolicy( |
| 68 base::FeatureList::IsEnabled(features::kFeaturePolicy)); |
| 69 |
| 67 if (command_line.HasSwitch(switches::kEnableWebBluetooth)) | 70 if (command_line.HasSwitch(switches::kEnableWebBluetooth)) |
| 68 WebRuntimeFeatures::enableWebBluetooth(true); | 71 WebRuntimeFeatures::enableWebBluetooth(true); |
| 69 | 72 |
| 70 if (!base::FeatureList::IsEnabled(features::kWebUsb)) | 73 if (!base::FeatureList::IsEnabled(features::kWebUsb)) |
| 71 WebRuntimeFeatures::enableWebUsb(false); | 74 WebRuntimeFeatures::enableWebUsb(false); |
| 72 | 75 |
| 73 SetRuntimeFeatureDefaultsForPlatform(); | 76 SetRuntimeFeatureDefaultsForPlatform(); |
| 74 | 77 |
| 75 if (command_line.HasSwitch(switches::kDisableDatabases)) | 78 if (command_line.HasSwitch(switches::kDisableDatabases)) |
| 76 WebRuntimeFeatures::enableDatabase(false); | 79 WebRuntimeFeatures::enableDatabase(false); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 285 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 283 std::vector<std::string> disabled_features = base::SplitString( | 286 std::vector<std::string> disabled_features = base::SplitString( |
| 284 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 287 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 285 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 288 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 286 for (const std::string& feature : disabled_features) | 289 for (const std::string& feature : disabled_features) |
| 287 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 290 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 288 } | 291 } |
| 289 } | 292 } |
| 290 | 293 |
| 291 } // namespace content | 294 } // namespace content |
| OLD | NEW |