| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/common/content_switches_internal.h" | 8 #include "content/common/content_switches_internal.h" |
| 9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 10 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 10 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 11 #include "ui/native_theme/native_theme_switches.h" | 11 #include "ui/native_theme/native_theme_switches.h" |
| 12 | 12 |
| 13 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 14 #include <cpu-features.h> | 14 #include <cpu-features.h> |
| 15 #include "base/android/build_info.h" | 15 #include "base/android/build_info.h" |
| 16 #include "base/metrics/field_trial.h" |
| 16 #include "media/base/android/media_codec_bridge.h" | 17 #include "media/base/android/media_codec_bridge.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 using blink::WebRuntimeFeatures; | 20 using blink::WebRuntimeFeatures; |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 | 23 |
| 23 static void SetRuntimeFeatureDefaultsForPlatform() { | 24 static void SetRuntimeFeatureDefaultsForPlatform() { |
| 24 #if defined(OS_ANDROID) | 25 #if defined(OS_ANDROID) |
| 25 // MSE/EME implementation needs Android MediaCodec API. | 26 // MSE/EME implementation needs Android MediaCodec API. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 46 // Android does not yet support the Web Notification API. crbug.com/115320 | 47 // Android does not yet support the Web Notification API. crbug.com/115320 |
| 47 WebRuntimeFeatures::enableNotifications(false); | 48 WebRuntimeFeatures::enableNotifications(false); |
| 48 // Android does not yet support SharedWorker. crbug.com/154571 | 49 // Android does not yet support SharedWorker. crbug.com/154571 |
| 49 WebRuntimeFeatures::enableSharedWorker(false); | 50 WebRuntimeFeatures::enableSharedWorker(false); |
| 50 // Android does not yet support NavigatorContentUtils. | 51 // Android does not yet support NavigatorContentUtils. |
| 51 WebRuntimeFeatures::enableNavigatorContentUtils(false); | 52 WebRuntimeFeatures::enableNavigatorContentUtils(false); |
| 52 WebRuntimeFeatures::enableTouchIconLoading(true); | 53 WebRuntimeFeatures::enableTouchIconLoading(true); |
| 53 WebRuntimeFeatures::enableOrientationEvent(true); | 54 WebRuntimeFeatures::enableOrientationEvent(true); |
| 54 WebRuntimeFeatures::enableFastMobileScrolling(true); | 55 WebRuntimeFeatures::enableFastMobileScrolling(true); |
| 55 WebRuntimeFeatures::enableMediaCapture(true); | 56 WebRuntimeFeatures::enableMediaCapture(true); |
| 57 // If navigation transitions gets activated via field trial, enable it in |
| 58 // blink. We don't set this to false in case the user has manually enabled |
| 59 // the feature via experimental web platform features. |
| 60 if (base::FieldTrialList::FindFullName("NavigationTransitions") == "Enabled") |
| 61 WebRuntimeFeatures::enableNavigationTransitions(true); |
| 56 #else | 62 #else |
| 57 WebRuntimeFeatures::enableNavigatorContentUtils(true); | 63 WebRuntimeFeatures::enableNavigatorContentUtils(true); |
| 58 #endif // defined(OS_ANDROID) | 64 #endif // defined(OS_ANDROID) |
| 59 } | 65 } |
| 60 | 66 |
| 61 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( | 67 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( |
| 62 const CommandLine& command_line) { | 68 const CommandLine& command_line) { |
| 63 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) | 69 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) |
| 64 WebRuntimeFeatures::enableExperimentalFeatures(true); | 70 WebRuntimeFeatures::enableExperimentalFeatures(true); |
| 65 | 71 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 WebRuntimeFeatures::enableBleedingEdgeFastPaths(true); | 157 WebRuntimeFeatures::enableBleedingEdgeFastPaths(true); |
| 152 | 158 |
| 153 if (command_line.HasSwitch(switches::kEnablePreciseMemoryInfo)) | 159 if (command_line.HasSwitch(switches::kEnablePreciseMemoryInfo)) |
| 154 WebRuntimeFeatures::enablePreciseMemoryInfo(true); | 160 WebRuntimeFeatures::enablePreciseMemoryInfo(true); |
| 155 | 161 |
| 156 if (command_line.HasSwitch(switches::kEnableLayerSquashing)) | 162 if (command_line.HasSwitch(switches::kEnableLayerSquashing)) |
| 157 WebRuntimeFeatures::enableLayerSquashing(true); | 163 WebRuntimeFeatures::enableLayerSquashing(true); |
| 158 } | 164 } |
| 159 | 165 |
| 160 } // namespace content | 166 } // namespace content |
| OLD | NEW |