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/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 AndroidCpuFamily cpu_family = android_getCpuFamily(); | 41 AndroidCpuFamily cpu_family = android_getCpuFamily(); |
42 WebRuntimeFeatures::enableWebAudio( | 42 WebRuntimeFeatures::enableWebAudio( |
43 media::MediaCodecBridge::IsAvailable() && | 43 media::MediaCodecBridge::IsAvailable() && |
44 ((cpu_family == ANDROID_CPU_FAMILY_ARM) || | 44 ((cpu_family == ANDROID_CPU_FAMILY_ARM) || |
45 (cpu_family == ANDROID_CPU_FAMILY_ARM64) || | 45 (cpu_family == ANDROID_CPU_FAMILY_ARM64) || |
46 (cpu_family == ANDROID_CPU_FAMILY_X86) || | 46 (cpu_family == ANDROID_CPU_FAMILY_X86) || |
47 (cpu_family == ANDROID_CPU_FAMILY_MIPS))); | 47 (cpu_family == ANDROID_CPU_FAMILY_MIPS))); |
48 | 48 |
49 // Android does not have support for PagePopup | 49 // Android does not have support for PagePopup |
50 WebRuntimeFeatures::enablePagePopup(false); | 50 WebRuntimeFeatures::enablePagePopup(false); |
51 // Android does not yet support the Web Notification API. crbug.com/115320 | |
52 WebRuntimeFeatures::enableNotifications(false); | |
53 // Android does not yet support SharedWorker. crbug.com/154571 | 51 // Android does not yet support SharedWorker. crbug.com/154571 |
54 WebRuntimeFeatures::enableSharedWorker(false); | 52 WebRuntimeFeatures::enableSharedWorker(false); |
55 // Android does not yet support NavigatorContentUtils. | 53 // Android does not yet support NavigatorContentUtils. |
56 WebRuntimeFeatures::enableNavigatorContentUtils(false); | 54 WebRuntimeFeatures::enableNavigatorContentUtils(false); |
57 WebRuntimeFeatures::enableTouchIconLoading(true); | 55 WebRuntimeFeatures::enableTouchIconLoading(true); |
58 WebRuntimeFeatures::enableOrientationEvent(true); | 56 WebRuntimeFeatures::enableOrientationEvent(true); |
59 WebRuntimeFeatures::enableFastMobileScrolling(true); | 57 WebRuntimeFeatures::enableFastMobileScrolling(true); |
60 WebRuntimeFeatures::enableMediaCapture(true); | 58 WebRuntimeFeatures::enableMediaCapture(true); |
61 WebRuntimeFeatures::enableCompositedSelectionUpdate(true); | 59 WebRuntimeFeatures::enableCompositedSelectionUpdate(true); |
62 // If navigation transitions gets activated via field trial, enable it in | 60 // If navigation transitions gets activated via field trial, enable it in |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 93 |
96 if (command_line.HasSwitch(switches::kDisableBlinkScheduler)) | 94 if (command_line.HasSwitch(switches::kDisableBlinkScheduler)) |
97 WebRuntimeFeatures::enableBlinkScheduler(false); | 95 WebRuntimeFeatures::enableBlinkScheduler(false); |
98 | 96 |
99 if (command_line.HasSwitch(switches::kDisableLocalStorage)) | 97 if (command_line.HasSwitch(switches::kDisableLocalStorage)) |
100 WebRuntimeFeatures::enableLocalStorage(false); | 98 WebRuntimeFeatures::enableLocalStorage(false); |
101 | 99 |
102 if (command_line.HasSwitch(switches::kDisableMediaSource)) | 100 if (command_line.HasSwitch(switches::kDisableMediaSource)) |
103 WebRuntimeFeatures::enableMediaSource(false); | 101 WebRuntimeFeatures::enableMediaSource(false); |
104 | 102 |
| 103 if (command_line.HasSwitch(switches::kDisableNotifications)) { |
| 104 WebRuntimeFeatures::enableNotifications(false); |
| 105 |
| 106 // Chrome's Push Messaging implementation relies on Web Notifications. |
| 107 WebRuntimeFeatures::enablePushMessaging(false); |
| 108 } |
| 109 |
105 if (command_line.HasSwitch(switches::kDisableSharedWorkers)) | 110 if (command_line.HasSwitch(switches::kDisableSharedWorkers)) |
106 WebRuntimeFeatures::enableSharedWorker(false); | 111 WebRuntimeFeatures::enableSharedWorker(false); |
107 | 112 |
108 #if defined(OS_ANDROID) | 113 #if defined(OS_ANDROID) |
109 if (command_line.HasSwitch(switches::kDisableWebRTC)) | 114 if (command_line.HasSwitch(switches::kDisableWebRTC)) |
110 WebRuntimeFeatures::enablePeerConnection(false); | 115 WebRuntimeFeatures::enablePeerConnection(false); |
111 | 116 |
112 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) | 117 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) |
113 WebRuntimeFeatures::enableNotifications(true); | 118 WebRuntimeFeatures::enableNotifications(true); |
114 | 119 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', | 217 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', |
213 &disabled_features); | 218 &disabled_features); |
214 for (const std::string& feature : disabled_features) { | 219 for (const std::string& feature : disabled_features) { |
215 WebRuntimeFeatures::enableFeatureFromString( | 220 WebRuntimeFeatures::enableFeatureFromString( |
216 blink::WebString::fromLatin1(feature), false); | 221 blink::WebString::fromLatin1(feature), false); |
217 } | 222 } |
218 } | 223 } |
219 } | 224 } |
220 | 225 |
221 } // namespace content | 226 } // namespace content |
OLD | NEW |