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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 switches::kEnableExperimentalWebPlatformFeatures); | 62 switches::kEnableExperimentalWebPlatformFeatures); |
63 if (enableExperimentalWebPlatformFeatures) | 63 if (enableExperimentalWebPlatformFeatures) |
64 WebRuntimeFeatures::enableExperimentalFeatures(true); | 64 WebRuntimeFeatures::enableExperimentalFeatures(true); |
65 | 65 |
66 WebRuntimeFeatures::enableOriginTrials( | 66 WebRuntimeFeatures::enableOriginTrials( |
67 base::FeatureList::IsEnabled(features::kOriginTrials)); | 67 base::FeatureList::IsEnabled(features::kOriginTrials)); |
68 | 68 |
69 WebRuntimeFeatures::enableFeaturePolicy( | 69 WebRuntimeFeatures::enableFeaturePolicy( |
70 base::FeatureList::IsEnabled(features::kFeaturePolicy)); | 70 base::FeatureList::IsEnabled(features::kFeaturePolicy)); |
71 | 71 |
72 if (command_line.HasSwitch(switches::kEnableWebBluetooth)) | 72 // Web Bluetooth is shipped on Android, ChromeOS & MacOS, experimental |
73 WebRuntimeFeatures::enableWebBluetooth(true); | 73 // otherwise. |
| 74 bool enable_web_bluetooth = enableExperimentalWebPlatformFeatures; |
| 75 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_MACOSX) |
| 76 enable_web_bluetooth = true; |
| 77 #endif |
| 78 WebRuntimeFeatures::enableWebBluetooth(enable_web_bluetooth); |
74 | 79 |
75 if (!base::FeatureList::IsEnabled(features::kWebUsb)) | 80 if (!base::FeatureList::IsEnabled(features::kWebUsb)) |
76 WebRuntimeFeatures::enableWebUsb(false); | 81 WebRuntimeFeatures::enableWebUsb(false); |
77 | 82 |
78 SetRuntimeFeatureDefaultsForPlatform(); | 83 SetRuntimeFeatureDefaultsForPlatform(); |
79 | 84 |
80 if (command_line.HasSwitch(switches::kDisableDatabases)) | 85 if (command_line.HasSwitch(switches::kDisableDatabases)) |
81 WebRuntimeFeatures::enableDatabase(false); | 86 WebRuntimeFeatures::enableDatabase(false); |
82 | 87 |
83 if (command_line.HasSwitch(switches::kDisableNotifications)) { | 88 if (command_line.HasSwitch(switches::kDisableNotifications)) { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 333 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
329 std::vector<std::string> disabled_features = base::SplitString( | 334 std::vector<std::string> disabled_features = base::SplitString( |
330 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 335 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
331 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 336 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
332 for (const std::string& feature : disabled_features) | 337 for (const std::string& feature : disabled_features) |
333 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 338 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
334 } | 339 } |
335 } | 340 } |
336 | 341 |
337 } // namespace content | 342 } // namespace content |
OLD | NEW |