1 /*
2  * Copyright (C) 2013 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #include "third_party/blink/public/platform/web_runtime_features.h"
32 
33 #include "third_party/blink/renderer/platform/graphics/scrollbar_theme_settings.h"
34 #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
35 #include "third_party/blink/renderer/platform/wtf/assertions.h"
36 
37 namespace blink {
38 
EnableBlockingFocusWithoutUserActivation(bool enable)39 void WebRuntimeFeatures::EnableBlockingFocusWithoutUserActivation(bool enable) {
40   RuntimeEnabledFeatures::SetBlockingFocusWithoutUserActivationEnabled(enable);
41 }
42 
EnableBrowserVerifiedUserActivationKeyboard(bool enable)43 void WebRuntimeFeatures::EnableBrowserVerifiedUserActivationKeyboard(
44     bool enable) {
45   RuntimeEnabledFeatures::SetBrowserVerifiedUserActivationKeyboardEnabled(
46       enable);
47 }
48 
EnableBrowserVerifiedUserActivationMouse(bool enable)49 void WebRuntimeFeatures::EnableBrowserVerifiedUserActivationMouse(bool enable) {
50   RuntimeEnabledFeatures::SetBrowserVerifiedUserActivationMouseEnabled(enable);
51 }
52 
EnableClickPointerEvent(bool enable)53 void WebRuntimeFeatures::EnableClickPointerEvent(bool enable) {
54   RuntimeEnabledFeatures::SetClickPointerEventEnabled(enable);
55 }
56 
EnableExperimentalFeatures(bool enable)57 void WebRuntimeFeatures::EnableExperimentalFeatures(bool enable) {
58   RuntimeEnabledFeatures::SetExperimentalFeaturesEnabled(enable);
59 }
60 
EnableWebBluetooth(bool enable)61 void WebRuntimeFeatures::EnableWebBluetooth(bool enable) {
62   RuntimeEnabledFeatures::SetWebBluetoothEnabled(enable);
63 }
64 
EnableWebBluetoothRemoteCharacteristicNewWriteValue(bool enable)65 void WebRuntimeFeatures::EnableWebBluetoothRemoteCharacteristicNewWriteValue(
66     bool enable) {
67   RuntimeEnabledFeatures::
68       SetWebBluetoothRemoteCharacteristicNewWriteValueEnabled(enable);
69 }
70 
EnableWebNfc(bool enable)71 void WebRuntimeFeatures::EnableWebNfc(bool enable) {
72   RuntimeEnabledFeatures::SetWebNFCEnabled(enable);
73 }
74 
EnableWebUsb(bool enable)75 void WebRuntimeFeatures::EnableWebUsb(bool enable) {
76   RuntimeEnabledFeatures::SetWebUSBEnabled(enable);
77 }
78 
EnableFeatureFromString(const std::string & name,bool enable)79 void WebRuntimeFeatures::EnableFeatureFromString(const std::string& name,
80                                                  bool enable) {
81   RuntimeEnabledFeatures::SetFeatureEnabledFromString(name, enable);
82 }
83 
EnableForcedColors(bool enable)84 void WebRuntimeFeatures::EnableForcedColors(bool enable) {
85   RuntimeEnabledFeatures::SetForcedColorsEnabled(enable);
86 }
87 
EnableFractionalScrollOffsets(bool enable)88 void WebRuntimeFeatures::EnableFractionalScrollOffsets(bool enable) {
89   RuntimeEnabledFeatures::SetFractionalScrollOffsetsEnabled(enable);
90 }
91 
EnableTestOnlyFeatures(bool enable)92 void WebRuntimeFeatures::EnableTestOnlyFeatures(bool enable) {
93   RuntimeEnabledFeatures::SetTestFeaturesEnabled(enable);
94 }
95 
EnableOriginTrialControlledFeatures(bool enable)96 void WebRuntimeFeatures::EnableOriginTrialControlledFeatures(bool enable) {
97   RuntimeEnabledFeatures::SetOriginTrialControlledFeaturesEnabled(enable);
98 }
99 
EnableAccelerated2dCanvas(bool enable)100 void WebRuntimeFeatures::EnableAccelerated2dCanvas(bool enable) {
101   RuntimeEnabledFeatures::SetAccelerated2dCanvasEnabled(enable);
102 }
103 
EnableAccessibilityExposeDisplayNone(bool enable)104 void WebRuntimeFeatures::EnableAccessibilityExposeDisplayNone(bool enable) {
105   RuntimeEnabledFeatures::SetAccessibilityExposeDisplayNoneEnabled(enable);
106 }
107 
EnableAccessibilityExposeHTMLElement(bool enable)108 void WebRuntimeFeatures::EnableAccessibilityExposeHTMLElement(bool enable) {
109   RuntimeEnabledFeatures::SetAccessibilityExposeHTMLElementEnabled(enable);
110 }
111 
EnableAccessibilityExposeIgnoredNodes(bool enable)112 void WebRuntimeFeatures::EnableAccessibilityExposeIgnoredNodes(bool enable) {
113   RuntimeEnabledFeatures::SetAccessibilityExposeIgnoredNodesEnabled(enable);
114 }
115 
EnableAccessibilityObjectModel(bool enable)116 void WebRuntimeFeatures::EnableAccessibilityObjectModel(bool enable) {
117   RuntimeEnabledFeatures::SetAccessibilityObjectModelEnabled(enable);
118 }
119 
EnableAccessibilityUseAXPositionForDocumentMarkers(bool enable)120 void WebRuntimeFeatures::EnableAccessibilityUseAXPositionForDocumentMarkers(
121     bool enable) {
122   RuntimeEnabledFeatures::
123       SetAccessibilityUseAXPositionForDocumentMarkersEnabled(enable);
124 }
125 
EnableAdTagging(bool enable)126 void WebRuntimeFeatures::EnableAdTagging(bool enable) {
127   RuntimeEnabledFeatures::SetAdTaggingEnabled(enable);
128 }
129 
EnableAllowActivationDelegationAttr(bool enable)130 void WebRuntimeFeatures::EnableAllowActivationDelegationAttr(bool enable) {
131   RuntimeEnabledFeatures::SetAllowActivationDelegationAttrEnabled(enable);
132 }
133 
EnableAutomaticLazyFrameLoading(bool enable)134 void WebRuntimeFeatures::EnableAutomaticLazyFrameLoading(bool enable) {
135   RuntimeEnabledFeatures::SetAutomaticLazyFrameLoadingEnabled(enable);
136 }
137 
EnableAutomaticLazyImageLoading(bool enable)138 void WebRuntimeFeatures::EnableAutomaticLazyImageLoading(bool enable) {
139   RuntimeEnabledFeatures::SetAutomaticLazyImageLoadingEnabled(enable);
140 }
141 
EnableCacheInlineScriptCode(bool enable)142 void WebRuntimeFeatures::EnableCacheInlineScriptCode(bool enable) {
143   RuntimeEnabledFeatures::SetCacheInlineScriptCodeEnabled(enable);
144 }
145 
EnableCookieDeprecationMessages(bool enable)146 void WebRuntimeFeatures::EnableCookieDeprecationMessages(bool enable) {
147   RuntimeEnabledFeatures::SetCookieDeprecationMessagesEnabled(enable);
148 }
149 
EnableCookiesWithoutSameSiteMustBeSecure(bool enable)150 void WebRuntimeFeatures::EnableCookiesWithoutSameSiteMustBeSecure(bool enable) {
151   RuntimeEnabledFeatures::SetCookiesWithoutSameSiteMustBeSecureEnabled(enable);
152 }
153 
EnableCanvas2dImageChromium(bool enable)154 void WebRuntimeFeatures::EnableCanvas2dImageChromium(bool enable) {
155   RuntimeEnabledFeatures::SetCanvas2dImageChromiumEnabled(enable);
156 }
157 
EnableCompositedSelectionUpdate(bool enable)158 void WebRuntimeFeatures::EnableCompositedSelectionUpdate(bool enable) {
159   RuntimeEnabledFeatures::SetCompositedSelectionUpdateEnabled(enable);
160 }
161 
EnableCSSHexAlphaColor(bool enable)162 void WebRuntimeFeatures::EnableCSSHexAlphaColor(bool enable) {
163   RuntimeEnabledFeatures::SetCSSHexAlphaColorEnabled(enable);
164 }
165 
EnableSameSiteByDefaultCookies(bool enable)166 void WebRuntimeFeatures::EnableSameSiteByDefaultCookies(bool enable) {
167   RuntimeEnabledFeatures::SetSameSiteByDefaultCookiesEnabled(enable);
168 }
169 
EnableScrollTopLeftInterop(bool enable)170 void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
171   RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
172 }
173 
EnableKeyboardFocusableScrollers(bool enable)174 void WebRuntimeFeatures::EnableKeyboardFocusableScrollers(bool enable) {
175   RuntimeEnabledFeatures::SetKeyboardFocusableScrollersEnabled(enable);
176 }
177 
EnableDatabase(bool enable)178 void WebRuntimeFeatures::EnableDatabase(bool enable) {
179   RuntimeEnabledFeatures::SetDatabaseEnabled(enable);
180 }
181 
EnableDecodeJpeg420ImagesToYUV(bool enable)182 void WebRuntimeFeatures::EnableDecodeJpeg420ImagesToYUV(bool enable) {
183   RuntimeEnabledFeatures::SetDecodeJpeg420ImagesToYUVEnabled(enable);
184 }
185 
EnableDecodeLossyWebPImagesToYUV(bool enable)186 void WebRuntimeFeatures::EnableDecodeLossyWebPImagesToYUV(bool enable) {
187   RuntimeEnabledFeatures::SetDecodeLossyWebPImagesToYUVEnabled(enable);
188 }
189 
EnableFeaturePolicyForSandbox(bool enable)190 void WebRuntimeFeatures::EnableFeaturePolicyForSandbox(bool enable) {
191   RuntimeEnabledFeatures::SetFeaturePolicyForSandboxEnabled(enable);
192 }
193 
EnableFileSystem(bool enable)194 void WebRuntimeFeatures::EnableFileSystem(bool enable) {
195   RuntimeEnabledFeatures::SetFileSystemEnabled(enable);
196 }
197 
EnableGenericSensorExtraClasses(bool enable)198 void WebRuntimeFeatures::EnableGenericSensorExtraClasses(bool enable) {
199   RuntimeEnabledFeatures::SetSensorExtraClassesEnabled(enable);
200 }
201 
EnableImplicitRootScroller(bool enable)202 void WebRuntimeFeatures::EnableImplicitRootScroller(bool enable) {
203   RuntimeEnabledFeatures::SetImplicitRootScrollerEnabled(enable);
204 }
205 
EnableLazyFrameLoading(bool enable)206 void WebRuntimeFeatures::EnableLazyFrameLoading(bool enable) {
207   RuntimeEnabledFeatures::SetLazyFrameLoadingEnabled(enable);
208 }
209 
EnableLazyFrameVisibleLoadTimeMetrics(bool enable)210 void WebRuntimeFeatures::EnableLazyFrameVisibleLoadTimeMetrics(bool enable) {
211   RuntimeEnabledFeatures::SetLazyFrameVisibleLoadTimeMetricsEnabled(enable);
212 }
213 
EnableLazyImageLoading(bool enable)214 void WebRuntimeFeatures::EnableLazyImageLoading(bool enable) {
215   RuntimeEnabledFeatures::SetLazyImageLoadingEnabled(enable);
216 }
217 
EnableLazyImageVisibleLoadTimeMetrics(bool enable)218 void WebRuntimeFeatures::EnableLazyImageVisibleLoadTimeMetrics(bool enable) {
219   RuntimeEnabledFeatures::SetLazyImageVisibleLoadTimeMetricsEnabled(enable);
220 }
221 
EnableMediaFeeds(bool enable)222 void WebRuntimeFeatures::EnableMediaFeeds(bool enable) {
223   RuntimeEnabledFeatures::SetMediaFeedsEnabled(enable);
224 }
225 
EnableMediaSession(bool enable)226 void WebRuntimeFeatures::EnableMediaSession(bool enable) {
227   RuntimeEnabledFeatures::SetMediaSessionEnabled(enable);
228 }
229 
EnableNotificationContentImage(bool enable)230 void WebRuntimeFeatures::EnableNotificationContentImage(bool enable) {
231   RuntimeEnabledFeatures::SetNotificationContentImageEnabled(enable);
232 }
233 
EnableNotifications(bool enable)234 void WebRuntimeFeatures::EnableNotifications(bool enable) {
235   RuntimeEnabledFeatures::SetNotificationsEnabled(enable);
236 }
237 
EnableNetInfoDownlinkMax(bool enable)238 void WebRuntimeFeatures::EnableNetInfoDownlinkMax(bool enable) {
239   RuntimeEnabledFeatures::SetNetInfoDownlinkMaxEnabled(enable);
240 }
241 
EnableNeverSlowMode(bool enable)242 void WebRuntimeFeatures::EnableNeverSlowMode(bool enable) {
243   RuntimeEnabledFeatures::SetNeverSlowModeEnabled(enable);
244 }
245 
EnablePaymentApp(bool enable)246 void WebRuntimeFeatures::EnablePaymentApp(bool enable) {
247   RuntimeEnabledFeatures::SetPaymentAppEnabled(enable);
248 }
249 
EnablePaymentHandlerMinimalUI(bool enable)250 void WebRuntimeFeatures::EnablePaymentHandlerMinimalUI(bool enable) {
251   RuntimeEnabledFeatures::SetPaymentHandlerMinimalUIEnabled(enable);
252 }
253 
EnablePaymentRequest(bool enable)254 void WebRuntimeFeatures::EnablePaymentRequest(bool enable) {
255   RuntimeEnabledFeatures::SetPaymentRequestEnabled(enable);
256   if (!enable) {
257     // Disable features that depend on Payment Request API.
258     RuntimeEnabledFeatures::SetPaymentAppEnabled(false);
259     RuntimeEnabledFeatures::SetPaymentHandlerMinimalUIEnabled(false);
260     RuntimeEnabledFeatures::SetPaymentMethodChangeEventEnabled(false);
261   }
262 }
263 
EnablePercentBasedScrolling(bool enable)264 void WebRuntimeFeatures::EnablePercentBasedScrolling(bool enable) {
265   RuntimeEnabledFeatures::SetPercentBasedScrollingEnabled(enable);
266 }
267 
EnablePerformanceManagerInstrumentation(bool enable)268 void WebRuntimeFeatures::EnablePerformanceManagerInstrumentation(bool enable) {
269   RuntimeEnabledFeatures::SetPerformanceManagerInstrumentationEnabled(enable);
270 }
271 
EnablePermissionsAPI(bool enable)272 void WebRuntimeFeatures::EnablePermissionsAPI(bool enable) {
273   RuntimeEnabledFeatures::SetPermissionsEnabled(enable);
274 }
275 
EnablePeriodicBackgroundSync(bool enable)276 void WebRuntimeFeatures::EnablePeriodicBackgroundSync(bool enable) {
277   RuntimeEnabledFeatures::SetPeriodicBackgroundSyncEnabled(enable);
278 }
279 
EnablePictureInPicture(bool enable)280 void WebRuntimeFeatures::EnablePictureInPicture(bool enable) {
281   RuntimeEnabledFeatures::SetPictureInPictureEnabled(enable);
282 }
283 
EnablePictureInPictureAPI(bool enable)284 void WebRuntimeFeatures::EnablePictureInPictureAPI(bool enable) {
285   RuntimeEnabledFeatures::SetPictureInPictureAPIEnabled(enable);
286 }
287 
EnablePointerLockOptions(bool enable)288 void WebRuntimeFeatures::EnablePointerLockOptions(bool enable) {
289   RuntimeEnabledFeatures::SetPointerLockOptionsEnabled(enable);
290 }
291 
EnablePortals(bool enable)292 void WebRuntimeFeatures::EnablePortals(bool enable) {
293   RuntimeEnabledFeatures::SetPortalsEnabled(enable);
294 }
295 
IsPortalsEnabled()296 bool WebRuntimeFeatures::IsPortalsEnabled() {
297   return RuntimeEnabledFeatures::PortalsEnabledByRuntimeFlag();
298 }
299 
EnableScriptedSpeechRecognition(bool enable)300 void WebRuntimeFeatures::EnableScriptedSpeechRecognition(bool enable) {
301   RuntimeEnabledFeatures::SetScriptedSpeechRecognitionEnabled(enable);
302 }
303 
EnableScriptedSpeechSynthesis(bool enable)304 void WebRuntimeFeatures::EnableScriptedSpeechSynthesis(bool enable) {
305   RuntimeEnabledFeatures::SetScriptedSpeechSynthesisEnabled(enable);
306 }
307 
EnableUserActivationSameOriginVisibility(bool enable)308 void WebRuntimeFeatures::EnableUserActivationSameOriginVisibility(bool enable) {
309   RuntimeEnabledFeatures::SetUserActivationSameOriginVisibilityEnabled(enable);
310 }
311 
EnableTouchEventFeatureDetection(bool enable)312 void WebRuntimeFeatures::EnableTouchEventFeatureDetection(bool enable) {
313   RuntimeEnabledFeatures::SetTouchEventFeatureDetectionEnabled(enable);
314 }
315 
EnableScrollUnification(bool enable)316 void WebRuntimeFeatures::EnableScrollUnification(bool enable) {
317   RuntimeEnabledFeatures::SetScrollUnificationEnabled(enable);
318 }
319 
EnableWebGLDraftExtensions(bool enable)320 void WebRuntimeFeatures::EnableWebGLDraftExtensions(bool enable) {
321   RuntimeEnabledFeatures::SetWebGLDraftExtensionsEnabled(enable);
322 }
323 
EnableWebGLImageChromium(bool enable)324 void WebRuntimeFeatures::EnableWebGLImageChromium(bool enable) {
325   RuntimeEnabledFeatures::SetWebGLImageChromiumEnabled(enable);
326 }
327 
EnableOverlayScrollbars(bool enable)328 void WebRuntimeFeatures::EnableOverlayScrollbars(bool enable) {
329   ScrollbarThemeSettings::SetOverlayScrollbarsEnabled(enable);
330 }
331 
ForceOverlayFullscreenVideo(bool enable)332 void WebRuntimeFeatures::ForceOverlayFullscreenVideo(bool enable) {
333   RuntimeEnabledFeatures::SetForceOverlayFullscreenVideoEnabled(enable);
334 }
335 
EnableSharedArrayBuffer(bool enable)336 void WebRuntimeFeatures::EnableSharedArrayBuffer(bool enable) {
337   RuntimeEnabledFeatures::SetSharedArrayBufferEnabled(enable);
338 }
339 
EnableSharedWorker(bool enable)340 void WebRuntimeFeatures::EnableSharedWorker(bool enable) {
341   RuntimeEnabledFeatures::SetSharedWorkerEnabled(enable);
342 }
343 
EnableTextFragmentAnchor(bool enable)344 void WebRuntimeFeatures::EnableTextFragmentAnchor(bool enable) {
345   RuntimeEnabledFeatures::SetTextFragmentIdentifiersEnabled(enable);
346 }
347 
EnablePreciseMemoryInfo(bool enable)348 void WebRuntimeFeatures::EnablePreciseMemoryInfo(bool enable) {
349   RuntimeEnabledFeatures::SetPreciseMemoryInfoEnabled(enable);
350 }
351 
EnableV8IdleTasks(bool enable)352 void WebRuntimeFeatures::EnableV8IdleTasks(bool enable) {
353   RuntimeEnabledFeatures::SetV8IdleTasksEnabled(enable);
354 }
355 
EnableDirectSockets(bool enable)356 void WebRuntimeFeatures::EnableDirectSockets(bool enable) {
357   RuntimeEnabledFeatures::SetDirectSocketsEnabled(enable);
358 }
359 
EnablePushMessaging(bool enable)360 void WebRuntimeFeatures::EnablePushMessaging(bool enable) {
361   RuntimeEnabledFeatures::SetPushMessagingEnabled(enable);
362 }
363 
EnablePushSubscriptionChangeEvent(bool enable)364 void WebRuntimeFeatures::EnablePushSubscriptionChangeEvent(bool enable) {
365   RuntimeEnabledFeatures::SetPushMessagingSubscriptionChangeEnabled(enable);
366 }
367 
EnableWebShare(bool enable)368 void WebRuntimeFeatures::EnableWebShare(bool enable) {
369   RuntimeEnabledFeatures::SetWebShareEnabled(enable);
370 }
371 
EnableWebGPU(bool enable)372 void WebRuntimeFeatures::EnableWebGPU(bool enable) {
373   RuntimeEnabledFeatures::SetWebGPUEnabled(enable);
374 }
375 
EnableWebXR(bool enable)376 void WebRuntimeFeatures::EnableWebXR(bool enable) {
377   RuntimeEnabledFeatures::SetWebXREnabled(enable);
378 }
379 
EnableWebXRAnchors(bool enable)380 void WebRuntimeFeatures::EnableWebXRAnchors(bool enable) {
381   RuntimeEnabledFeatures::SetWebXRAnchorsEnabled(enable);
382 }
383 
EnableWebXRARModule(bool enable)384 void WebRuntimeFeatures::EnableWebXRARModule(bool enable) {
385   RuntimeEnabledFeatures::SetWebXRARModuleEnabled(enable);
386 }
387 
EnableWebXRCameraAccess(bool enable)388 void WebRuntimeFeatures::EnableWebXRCameraAccess(bool enable) {
389   RuntimeEnabledFeatures::SetWebXRCameraAccessEnabled(enable);
390 }
391 
EnableWebXRDepth(bool enable)392 void WebRuntimeFeatures::EnableWebXRDepth(bool enable) {
393   RuntimeEnabledFeatures::SetWebXRDepthEnabled(enable);
394 }
395 
EnableWebXRHitTest(bool enable)396 void WebRuntimeFeatures::EnableWebXRHitTest(bool enable) {
397   RuntimeEnabledFeatures::SetWebXRHitTestEnabled(enable);
398 }
399 
EnableWebXRImageTracking(bool enable)400 void WebRuntimeFeatures::EnableWebXRImageTracking(bool enable) {
401   RuntimeEnabledFeatures::SetWebXRImageTrackingEnabled(enable);
402 }
403 
EnableWebXRLightEstimation(bool enable)404 void WebRuntimeFeatures::EnableWebXRLightEstimation(bool enable) {
405   RuntimeEnabledFeatures::SetWebXRLightEstimationEnabled(enable);
406 }
407 
EnableWebXRPlaneDetection(bool enable)408 void WebRuntimeFeatures::EnableWebXRPlaneDetection(bool enable) {
409   RuntimeEnabledFeatures::SetWebXRPlaneDetectionEnabled(enable);
410 }
411 
EnableWebXRViewportScale(bool enable)412 void WebRuntimeFeatures::EnableWebXRViewportScale(bool enable) {
413   RuntimeEnabledFeatures::SetWebXRViewportScaleEnabled(enable);
414 }
415 
EnableWheelEventRegions(bool enable)416 void WebRuntimeFeatures::EnableWheelEventRegions(bool enable) {
417   RuntimeEnabledFeatures::SetWheelEventRegionsEnabled(enable);
418 }
419 
EnablePresentationAPI(bool enable)420 void WebRuntimeFeatures::EnablePresentationAPI(bool enable) {
421   RuntimeEnabledFeatures::SetPresentationEnabled(enable);
422 }
423 
EnableRestrictAutomaticLazyFrameLoadingToDataSaver(bool enable)424 void WebRuntimeFeatures::EnableRestrictAutomaticLazyFrameLoadingToDataSaver(
425     bool enable) {
426   RuntimeEnabledFeatures::
427       SetRestrictAutomaticLazyFrameLoadingToDataSaverEnabled(enable);
428 }
429 
EnableRestrictAutomaticLazyImageLoadingToDataSaver(bool enable)430 void WebRuntimeFeatures::EnableRestrictAutomaticLazyImageLoadingToDataSaver(
431     bool enable) {
432   RuntimeEnabledFeatures::
433       SetRestrictAutomaticLazyImageLoadingToDataSaverEnabled(enable);
434 }
435 
EnableSecurePaymentConfirmationDebug(bool enable)436 void WebRuntimeFeatures::EnableSecurePaymentConfirmationDebug(bool enable) {
437   RuntimeEnabledFeatures::SetSecurePaymentConfirmationDebugEnabled(enable);
438 }
439 
EnableAutoLazyLoadOnReloads(bool enable)440 void WebRuntimeFeatures::EnableAutoLazyLoadOnReloads(bool enable) {
441   RuntimeEnabledFeatures::SetAutoLazyLoadOnReloadsEnabled(enable);
442 }
443 
EnableExpensiveBackgroundTimerThrottling(bool enable)444 void WebRuntimeFeatures::EnableExpensiveBackgroundTimerThrottling(bool enable) {
445   RuntimeEnabledFeatures::SetExpensiveBackgroundTimerThrottlingEnabled(enable);
446 }
447 
EnableTimerThrottlingForBackgroundTabs(bool enable)448 void WebRuntimeFeatures::EnableTimerThrottlingForBackgroundTabs(bool enable) {
449   RuntimeEnabledFeatures::SetTimerThrottlingForBackgroundTabsEnabled(enable);
450 }
451 
EnableTimerThrottlingForHiddenFrames(bool enable)452 void WebRuntimeFeatures::EnableTimerThrottlingForHiddenFrames(bool enable) {
453   RuntimeEnabledFeatures::SetTimerThrottlingForHiddenFramesEnabled(enable);
454 }
455 
EnableSendBeaconThrowForBlobWithNonSimpleType(bool enable)456 void WebRuntimeFeatures::EnableSendBeaconThrowForBlobWithNonSimpleType(
457     bool enable) {
458   RuntimeEnabledFeatures::SetSendBeaconThrowForBlobWithNonSimpleTypeEnabled(
459       enable);
460 }
461 
EnableRemotePlaybackAPI(bool enable)462 void WebRuntimeFeatures::EnableRemotePlaybackAPI(bool enable) {
463   RuntimeEnabledFeatures::SetRemotePlaybackEnabled(enable);
464 }
465 
EnableVideoPlaybackQuality(bool enable)466 void WebRuntimeFeatures::EnableVideoPlaybackQuality(bool enable) {
467   RuntimeEnabledFeatures::SetVideoPlaybackQualityEnabled(enable);
468 }
469 
EnableMediaControlsOverlayPlayButton(bool enable)470 void WebRuntimeFeatures::EnableMediaControlsOverlayPlayButton(bool enable) {
471   RuntimeEnabledFeatures::SetMediaControlsOverlayPlayButtonEnabled(enable);
472 }
473 
EnableMediaCastOverlayButton(bool enable)474 void WebRuntimeFeatures::EnableMediaCastOverlayButton(bool enable) {
475   RuntimeEnabledFeatures::SetMediaCastOverlayButtonEnabled(enable);
476 }
477 
EnableWebAuth(bool enable)478 void WebRuntimeFeatures::EnableWebAuth(bool enable) {
479   RuntimeEnabledFeatures::SetWebAuthEnabled(enable);
480 }
481 
EnableWebAuthenticationGetAssertionFeaturePolicy(bool enable)482 void WebRuntimeFeatures::EnableWebAuthenticationGetAssertionFeaturePolicy(
483     bool enable) {
484   RuntimeEnabledFeatures::SetWebAuthenticationGetAssertionFeaturePolicyEnabled(
485       enable);
486 }
487 
EnableLazyInitializeMediaControls(bool enable)488 void WebRuntimeFeatures::EnableLazyInitializeMediaControls(bool enable) {
489   RuntimeEnabledFeatures::SetLazyInitializeMediaControlsEnabled(enable);
490 }
491 
EnableMediaEngagementBypassAutoplayPolicies(bool enable)492 void WebRuntimeFeatures::EnableMediaEngagementBypassAutoplayPolicies(
493     bool enable) {
494   RuntimeEnabledFeatures::SetMediaEngagementBypassAutoplayPoliciesEnabled(
495       enable);
496 }
497 
EnableAutomationControlled(bool enable)498 void WebRuntimeFeatures::EnableAutomationControlled(bool enable) {
499   RuntimeEnabledFeatures::SetAutomationControlledEnabled(enable);
500 }
501 
EnableExperimentalProductivityFeatures(bool enable)502 void WebRuntimeFeatures::EnableExperimentalProductivityFeatures(bool enable) {
503   RuntimeEnabledFeatures::SetExperimentalProductivityFeaturesEnabled(enable);
504 }
505 
EnableDisallowDocumentAccess(bool enable)506 void WebRuntimeFeatures::EnableDisallowDocumentAccess(bool enable) {
507   RuntimeEnabledFeatures::SetDisallowDocumentAccessEnabled(enable);
508 }
509 
EnableDisplayCutoutAPI(bool enable)510 void WebRuntimeFeatures::EnableDisplayCutoutAPI(bool enable) {
511   RuntimeEnabledFeatures::SetDisplayCutoutAPIEnabled(enable);
512 }
513 
EnableDocumentPolicy(bool enable)514 void WebRuntimeFeatures::EnableDocumentPolicy(bool enable) {
515   RuntimeEnabledFeatures::SetDocumentPolicyEnabled(enable);
516 }
517 
EnableDocumentPolicyNegotiation(bool enable)518 void WebRuntimeFeatures::EnableDocumentPolicyNegotiation(bool enable) {
519   RuntimeEnabledFeatures::SetDocumentPolicyNegotiationEnabled(enable);
520 }
521 
EnableAutoplayIgnoresWebAudio(bool enable)522 void WebRuntimeFeatures::EnableAutoplayIgnoresWebAudio(bool enable) {
523   RuntimeEnabledFeatures::SetAutoplayIgnoresWebAudioEnabled(enable);
524 }
525 
EnableMediaControlsExpandGesture(bool enable)526 void WebRuntimeFeatures::EnableMediaControlsExpandGesture(bool enable) {
527   RuntimeEnabledFeatures::SetMediaControlsExpandGestureEnabled(enable);
528 }
529 
EnableBackgroundFetch(bool enable)530 void WebRuntimeFeatures::EnableBackgroundFetch(bool enable) {
531   RuntimeEnabledFeatures::SetBackgroundFetchEnabled(enable);
532 }
533 
EnableGetDisplayMedia(bool enable)534 void WebRuntimeFeatures::EnableGetDisplayMedia(bool enable) {
535   RuntimeEnabledFeatures::SetGetDisplayMediaEnabled(enable);
536 }
537 
EnableGetCurrentBrowsingContextMedia(bool enable)538 void WebRuntimeFeatures::EnableGetCurrentBrowsingContextMedia(bool enable) {
539   RuntimeEnabledFeatures::SetGetCurrentBrowsingContextMediaEnabled(enable);
540 }
541 
EnableAllowSyncXHRInPageDismissal(bool enable)542 void WebRuntimeFeatures::EnableAllowSyncXHRInPageDismissal(bool enable) {
543   RuntimeEnabledFeatures::SetAllowSyncXHRInPageDismissalEnabled(enable);
544 }
545 
EnableShadowDOMV0(bool enable)546 void WebRuntimeFeatures::EnableShadowDOMV0(bool enable) {
547   RuntimeEnabledFeatures::SetShadowDOMV0Enabled(enable);
548 }
549 
EnableCustomElementsV0(bool enable)550 void WebRuntimeFeatures::EnableCustomElementsV0(bool enable) {
551   RuntimeEnabledFeatures::SetCustomElementsV0Enabled(enable);
552 }
553 
EnableHTMLImports(bool enable)554 void WebRuntimeFeatures::EnableHTMLImports(bool enable) {
555   RuntimeEnabledFeatures::SetHTMLImportsEnabled(enable);
556 }
557 
EnableSignedExchangePrefetchCacheForNavigations(bool enable)558 void WebRuntimeFeatures::EnableSignedExchangePrefetchCacheForNavigations(
559     bool enable) {
560   RuntimeEnabledFeatures::SetSignedExchangePrefetchCacheForNavigationsEnabled(
561       enable);
562 }
563 
EnableSignedExchangeSubresourcePrefetch(bool enable)564 void WebRuntimeFeatures::EnableSignedExchangeSubresourcePrefetch(bool enable) {
565   RuntimeEnabledFeatures::SetSignedExchangeSubresourcePrefetchEnabled(enable);
566 }
567 
EnableSubresourceWebBundles(bool enable)568 void WebRuntimeFeatures::EnableSubresourceWebBundles(bool enable) {
569   RuntimeEnabledFeatures::SetSubresourceWebBundlesEnabled(enable);
570 }
571 
EnableIdleDetection(bool enable)572 void WebRuntimeFeatures::EnableIdleDetection(bool enable) {
573   RuntimeEnabledFeatures::SetIdleDetectionEnabled(enable);
574 }
575 
EnableSkipTouchEventFilter(bool enable)576 void WebRuntimeFeatures::EnableSkipTouchEventFilter(bool enable) {
577   RuntimeEnabledFeatures::SetSkipTouchEventFilterEnabled(enable);
578 }
579 
EnableWebOTP(bool enable)580 void WebRuntimeFeatures::EnableWebOTP(bool enable) {
581   RuntimeEnabledFeatures::SetWebOTPEnabled(enable);
582 }
583 
EnableConsolidatedMovementXY(bool enable)584 void WebRuntimeFeatures::EnableConsolidatedMovementXY(bool enable) {
585   RuntimeEnabledFeatures::SetConsolidatedMovementXYEnabled(enable);
586 }
587 
EnableCooperativeScheduling(bool enable)588 void WebRuntimeFeatures::EnableCooperativeScheduling(bool enable) {
589   RuntimeEnabledFeatures::SetCooperativeSchedulingEnabled(enable);
590 }
591 
EnableMouseSubframeNoImplicitCapture(bool enable)592 void WebRuntimeFeatures::EnableMouseSubframeNoImplicitCapture(bool enable) {
593   RuntimeEnabledFeatures::SetMouseSubframeNoImplicitCaptureEnabled(enable);
594 }
595 
EnableBackForwardCache(bool enable)596 void WebRuntimeFeatures::EnableBackForwardCache(bool enable) {
597   RuntimeEnabledFeatures::SetBackForwardCacheEnabled(enable);
598 }
599 
EnableTrustTokens(bool enable)600 void WebRuntimeFeatures::EnableTrustTokens(bool enable) {
601   RuntimeEnabledFeatures::SetTrustTokensEnabled(enable);
602 }
603 
EnableTrustTokensAlwaysAllowIssuance(bool enable)604 void WebRuntimeFeatures::EnableTrustTokensAlwaysAllowIssuance(bool enable) {
605   RuntimeEnabledFeatures::SetTrustTokensAlwaysAllowIssuanceEnabled(enable);
606 }
607 
EnableInstalledApp(bool enable)608 void WebRuntimeFeatures::EnableInstalledApp(bool enable) {
609   RuntimeEnabledFeatures::SetInstalledAppEnabled(enable);
610 }
611 
EnableTransformInterop(bool enable)612 void WebRuntimeFeatures::EnableTransformInterop(bool enable) {
613   RuntimeEnabledFeatures::SetTransformInteropEnabled(enable);
614 }
615 
EnableVideoWakeLockOptimisationHiddenMuted(bool enable)616 void WebRuntimeFeatures::EnableVideoWakeLockOptimisationHiddenMuted(
617     bool enable) {
618   RuntimeEnabledFeatures::SetVideoWakeLockOptimisationHiddenMutedEnabled(
619       enable);
620 }
621 
EnableContentIndex(bool enable)622 void WebRuntimeFeatures::EnableContentIndex(bool enable) {
623   RuntimeEnabledFeatures::SetContentIndexEnabled(enable);
624 }
625 
EnableRestrictGamepadAccess(bool enable)626 void WebRuntimeFeatures::EnableRestrictGamepadAccess(bool enable) {
627   RuntimeEnabledFeatures::SetRestrictGamepadAccessEnabled(enable);
628 }
629 
EnableCompositingOptimizations(bool enable)630 void WebRuntimeFeatures::EnableCompositingOptimizations(bool enable) {
631   RuntimeEnabledFeatures::SetCompositingOptimizationsEnabled(enable);
632 }
633 
EnableConversionMeasurementInfraSupport(bool enable)634 void WebRuntimeFeatures::EnableConversionMeasurementInfraSupport(bool enable) {
635   RuntimeEnabledFeatures::SetConversionMeasurementInfraSupportEnabled(enable);
636 }
637 
EnableParseUrlProtocolHandler(bool enable)638 void WebRuntimeFeatures::EnableParseUrlProtocolHandler(bool enable) {
639   RuntimeEnabledFeatures::SetParseUrlProtocolHandlerEnabled(enable);
640 }
641 
EnableWebID(bool enable)642 void WebRuntimeFeatures::EnableWebID(bool enable) {
643   RuntimeEnabledFeatures::SetWebIDEnabled(enable);
644 }
645 
EnableTargetBlankImpliesNoOpener(bool enable)646 void WebRuntimeFeatures::EnableTargetBlankImpliesNoOpener(bool enable) {
647   RuntimeEnabledFeatures::SetTargetBlankImpliesNoOpenerEnabled(enable);
648 }
649 
650 }  // namespace blink
651