| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #endif // defined(OS_ANDROID) | 46 #endif // defined(OS_ANDROID) |
| 47 | 47 |
| 48 #if defined(OS_ANDROID) || defined(USE_AURA) | 48 #if defined(OS_ANDROID) || defined(USE_AURA) |
| 49 WebRuntimeFeatures::enableCompositedSelectionUpdate(true); | 49 WebRuntimeFeatures::enableCompositedSelectionUpdate(true); |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 #if !(defined OS_ANDROID || defined OS_CHROMEOS) | 52 #if !(defined OS_ANDROID || defined OS_CHROMEOS) |
| 53 // Only Android, ChromeOS support NetInfo right now. | 53 // Only Android, ChromeOS support NetInfo right now. |
| 54 WebRuntimeFeatures::enableNetworkInformation(false); | 54 WebRuntimeFeatures::enableNetworkInformation(false); |
| 55 #endif | 55 #endif |
| 56 |
| 57 // Web Bluetooth is shipped on Android, ChromeOS & MacOS, experimental |
| 58 // otherwise. |
| 59 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_MACOSX) |
| 60 WebRuntimeFeatures::enableWebBluetooth(true); |
| 61 #endif |
| 56 } | 62 } |
| 57 | 63 |
| 58 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( | 64 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( |
| 59 const base::CommandLine& command_line) { | 65 const base::CommandLine& command_line) { |
| 60 bool enableExperimentalWebPlatformFeatures = command_line.HasSwitch( | 66 bool enableExperimentalWebPlatformFeatures = command_line.HasSwitch( |
| 61 switches::kEnableExperimentalWebPlatformFeatures); | 67 switches::kEnableExperimentalWebPlatformFeatures); |
| 62 if (enableExperimentalWebPlatformFeatures) | 68 if (enableExperimentalWebPlatformFeatures) |
| 63 WebRuntimeFeatures::enableExperimentalFeatures(true); | 69 WebRuntimeFeatures::enableExperimentalFeatures(true); |
| 64 | 70 |
| 65 WebRuntimeFeatures::enableOriginTrials( | 71 WebRuntimeFeatures::enableOriginTrials( |
| 66 base::FeatureList::IsEnabled(features::kOriginTrials)); | 72 base::FeatureList::IsEnabled(features::kOriginTrials)); |
| 67 | 73 |
| 68 WebRuntimeFeatures::enableFeaturePolicy( | 74 WebRuntimeFeatures::enableFeaturePolicy( |
| 69 base::FeatureList::IsEnabled(features::kFeaturePolicy)); | 75 base::FeatureList::IsEnabled(features::kFeaturePolicy)); |
| 70 | 76 |
| 71 if (command_line.HasSwitch(switches::kEnableWebBluetooth)) | |
| 72 WebRuntimeFeatures::enableWebBluetooth(true); | |
| 73 | |
| 74 if (!base::FeatureList::IsEnabled(features::kWebUsb)) | 77 if (!base::FeatureList::IsEnabled(features::kWebUsb)) |
| 75 WebRuntimeFeatures::enableWebUsb(false); | 78 WebRuntimeFeatures::enableWebUsb(false); |
| 76 | 79 |
| 77 SetRuntimeFeatureDefaultsForPlatform(); | 80 SetRuntimeFeatureDefaultsForPlatform(); |
| 78 | 81 |
| 79 if (command_line.HasSwitch(switches::kDisableDatabases)) | 82 if (command_line.HasSwitch(switches::kDisableDatabases)) |
| 80 WebRuntimeFeatures::enableDatabase(false); | 83 WebRuntimeFeatures::enableDatabase(false); |
| 81 | 84 |
| 82 if (command_line.HasSwitch(switches::kDisableNotifications)) { | 85 if (command_line.HasSwitch(switches::kDisableNotifications)) { |
| 83 WebRuntimeFeatures::enableNotifications(false); | 86 WebRuntimeFeatures::enableNotifications(false); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 328 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 326 std::vector<std::string> disabled_features = base::SplitString( | 329 std::vector<std::string> disabled_features = base::SplitString( |
| 327 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 330 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 328 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 331 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 329 for (const std::string& feature : disabled_features) | 332 for (const std::string& feature : disabled_features) |
| 330 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 333 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 331 } | 334 } |
| 332 } | 335 } |
| 333 | 336 |
| 334 } // namespace content | 337 } // namespace content |
| OLD | NEW |