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