| 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 "base/metrics/field_trial.h" |
| 17 #include "media/base/android/media_codec_bridge.h" | 17 #include "media/base/android/media_codec_bridge.h" |
| 18 #elif defined(OS_WIN) |
| 19 #include "base/win/windows_version.h" |
| 18 #endif | 20 #endif |
| 19 | 21 |
| 20 using blink::WebRuntimeFeatures; | 22 using blink::WebRuntimeFeatures; |
| 21 | 23 |
| 22 namespace content { | 24 namespace content { |
| 23 | 25 |
| 24 static void SetRuntimeFeatureDefaultsForPlatform() { | 26 static void SetRuntimeFeatureDefaultsForPlatform() { |
| 25 #if defined(OS_ANDROID) | 27 #if defined(OS_ANDROID) |
| 26 // MSE/EME implementation needs Android MediaCodec API. | 28 // MSE/EME implementation needs Android MediaCodec API. |
| 27 if (!media::MediaCodecBridge::IsAvailable()) { | 29 if (!media::MediaCodecBridge::IsAvailable()) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 if (base::FieldTrialList::FindFullName("NavigationTransitions") == "Enabled") | 62 if (base::FieldTrialList::FindFullName("NavigationTransitions") == "Enabled") |
| 61 WebRuntimeFeatures::enableNavigationTransitions(true); | 63 WebRuntimeFeatures::enableNavigationTransitions(true); |
| 62 #else | 64 #else |
| 63 WebRuntimeFeatures::enableNavigatorContentUtils(true); | 65 WebRuntimeFeatures::enableNavigatorContentUtils(true); |
| 64 #endif // defined(OS_ANDROID) | 66 #endif // defined(OS_ANDROID) |
| 65 | 67 |
| 66 #if !(defined OS_ANDROID || defined OS_CHROMEOS || defined OS_IOS) | 68 #if !(defined OS_ANDROID || defined OS_CHROMEOS || defined OS_IOS) |
| 67 // Only Android, ChromeOS, and IOS support NetInfo right now. | 69 // Only Android, ChromeOS, and IOS support NetInfo right now. |
| 68 WebRuntimeFeatures::enableNetworkInformation(false); | 70 WebRuntimeFeatures::enableNetworkInformation(false); |
| 69 #endif | 71 #endif |
| 72 |
| 73 #if defined(OS_WIN) |
| 74 // Screen Orientation API is currently broken on Windows 8 Metro mode and |
| 75 // until we can find how to disable it only for Blink instances running in a |
| 76 // renderer process in Metro, we need to disable the API altogether for Win8. |
| 77 // See http://crbug.com/400846 |
| 78 if (base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_WIN8) |
| 79 WebRuntimeFeatures::enableScreenOrientation(false); |
| 80 #endif // OS_WIN |
| 70 } | 81 } |
| 71 | 82 |
| 72 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( | 83 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( |
| 73 const CommandLine& command_line) { | 84 const CommandLine& command_line) { |
| 74 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) | 85 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) |
| 75 WebRuntimeFeatures::enableExperimentalFeatures(true); | 86 WebRuntimeFeatures::enableExperimentalFeatures(true); |
| 76 | 87 |
| 77 SetRuntimeFeatureDefaultsForPlatform(); | 88 SetRuntimeFeatureDefaultsForPlatform(); |
| 78 | 89 |
| 79 if (command_line.HasSwitch(switches::kDisableDatabases)) | 90 if (command_line.HasSwitch(switches::kDisableDatabases)) |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 WebRuntimeFeatures::enableLayerSquashing(true); | 173 WebRuntimeFeatures::enableLayerSquashing(true); |
| 163 | 174 |
| 164 if (command_line.HasSwitch(switches::kEnableNetworkInformation) || | 175 if (command_line.HasSwitch(switches::kEnableNetworkInformation) || |
| 165 command_line.HasSwitch( | 176 command_line.HasSwitch( |
| 166 switches::kEnableExperimentalWebPlatformFeatures)) { | 177 switches::kEnableExperimentalWebPlatformFeatures)) { |
| 167 WebRuntimeFeatures::enableNetworkInformation(true); | 178 WebRuntimeFeatures::enableNetworkInformation(true); |
| 168 } | 179 } |
| 169 } | 180 } |
| 170 | 181 |
| 171 } // namespace content | 182 } // namespace content |
| OLD | NEW |