[GStreamer] Flush get_range calls during PAUSED->READY in WebKitWebSource
[WebKit-https.git] / Source / WebKit / UIProcess / API / Cocoa / WKPreferences.mm
1 /*
2  * Copyright (C) 2014-2017 Apple 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
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import "config.h"
27 #import "WKPreferencesInternal.h"
28
29 #import "APIArray.h"
30 #import "PluginProcessManager.h"
31 #import "WKNSArray.h"
32 #import "WebPreferences.h"
33 #import "_WKExperimentalFeatureInternal.h"
34 #import "_WKInternalDebugFeatureInternal.h"
35 #import <WebCore/SecurityOrigin.h>
36 #import <WebCore/Settings.h>
37 #import <wtf/RetainPtr.h>
38
39 @implementation WKPreferences
40
41 - (instancetype)init
42 {
43     if (!(self = [super init]))
44         return nil;
45
46     API::Object::constructInWrapper<WebKit::WebPreferences>(self, String(), "WebKit", "WebKitDebug");
47     return self;
48 }
49
50 - (void)dealloc
51 {
52     _preferences->~WebPreferences();
53
54     [super dealloc];
55 }
56
57 + (BOOL)supportsSecureCoding
58 {
59     return YES;
60 }
61
62 // FIXME: We currently only encode/decode API preferences. We should consider whether we should
63 // encode/decode SPI preferences as well.
64
65 - (void)encodeWithCoder:(NSCoder *)coder
66 {
67     [coder encodeDouble:self.minimumFontSize forKey:@"minimumFontSize"];
68     [coder encodeBool:self.javaScriptEnabled forKey:@"javaScriptEnabled"];
69     [coder encodeBool:self.javaScriptCanOpenWindowsAutomatically forKey:@"javaScriptCanOpenWindowsAutomatically"];
70
71 #if PLATFORM(MAC)
72 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
73     [coder encodeBool:self.javaEnabled forKey:@"javaEnabled"];
74     [coder encodeBool:self.plugInsEnabled forKey:@"plugInsEnabled"];
75 ALLOW_DEPRECATED_DECLARATIONS_END
76     [coder encodeBool:self.tabFocusesLinks forKey:@"tabFocusesLinks"];
77 #endif
78 }
79
80 - (instancetype)initWithCoder:(NSCoder *)coder
81 {
82     if (!(self = [self init]))
83         return nil;
84
85     self.minimumFontSize = [coder decodeDoubleForKey:@"minimumFontSize"];
86     self.javaScriptEnabled = [coder decodeBoolForKey:@"javaScriptEnabled"];
87     self.javaScriptCanOpenWindowsAutomatically = [coder decodeBoolForKey:@"javaScriptCanOpenWindowsAutomatically"];
88
89 #if PLATFORM(MAC)
90 ALLOW_DEPRECATED_DECLARATIONS_BEGIN
91     self.javaEnabled = [coder decodeBoolForKey:@"javaEnabled"];
92     self.plugInsEnabled = [coder decodeBoolForKey:@"plugInsEnabled"];
93 ALLOW_DEPRECATED_DECLARATIONS_END
94     self.tabFocusesLinks = [coder decodeBoolForKey:@"tabFocusesLinks"];
95 #endif
96
97     return self;
98 }
99
100 - (id)copyWithZone:(NSZone *)zone
101 {
102     return [wrapper(_preferences->copy()) retain];
103 }
104
105 - (CGFloat)minimumFontSize
106 {
107     return _preferences->minimumFontSize();
108 }
109
110 - (void)setMinimumFontSize:(CGFloat)minimumFontSize
111 {
112     _preferences->setMinimumFontSize(minimumFontSize);
113 }
114
115 - (BOOL)javaScriptEnabled
116 {
117     return _preferences->javaScriptEnabled();
118 }
119
120 - (void)setJavaScriptEnabled:(BOOL)javaScriptEnabled
121 {
122     _preferences->setJavaScriptEnabled(javaScriptEnabled);
123 }
124
125 - (void)setFraudulentWebsiteWarningEnabled:(BOOL)enabled
126 {
127     _preferences->setSafeBrowsingEnabled(enabled);
128 }
129
130 - (BOOL)isFraudulentWebsiteWarningEnabled
131 {
132     return _preferences->safeBrowsingEnabled();
133 }
134
135 - (BOOL)javaScriptCanOpenWindowsAutomatically
136 {
137     return _preferences->javaScriptCanOpenWindowsAutomatically();
138 }
139
140 - (void)setJavaScriptCanOpenWindowsAutomatically:(BOOL)javaScriptCanOpenWindowsAutomatically
141 {
142     _preferences->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically);
143 }
144
145 #pragma mark OS X-specific methods
146
147 #if PLATFORM(MAC)
148
149 - (BOOL)tabFocusesLinks
150 {
151     return _preferences->tabsToLinks();
152 }
153
154 - (void)setTabFocusesLinks:(BOOL)tabFocusesLinks
155 {
156     _preferences->setTabsToLinks(tabFocusesLinks);
157 }
158
159 #endif
160
161 #pragma mark WKObject protocol implementation
162
163 - (API::Object&)_apiObject
164 {
165     return *_preferences;
166 }
167
168 @end
169
170 @implementation WKPreferences (WKPrivate)
171
172 - (BOOL)_telephoneNumberDetectionIsEnabled
173 {
174     return _preferences->telephoneNumberParsingEnabled();
175 }
176
177 - (void)_setTelephoneNumberDetectionIsEnabled:(BOOL)telephoneNumberDetectionIsEnabled
178 {
179     _preferences->setTelephoneNumberParsingEnabled(telephoneNumberDetectionIsEnabled);
180 }
181
182 static WebCore::SecurityOrigin::StorageBlockingPolicy toStorageBlockingPolicy(_WKStorageBlockingPolicy policy)
183 {
184     switch (policy) {
185     case _WKStorageBlockingPolicyAllowAll:
186         return WebCore::SecurityOrigin::AllowAllStorage;
187     case _WKStorageBlockingPolicyBlockThirdParty:
188         return WebCore::SecurityOrigin::BlockThirdPartyStorage;
189     case _WKStorageBlockingPolicyBlockAll:
190         return WebCore::SecurityOrigin::BlockAllStorage;
191     }
192
193     ASSERT_NOT_REACHED();
194     return WebCore::SecurityOrigin::AllowAllStorage;
195 }
196
197 static _WKStorageBlockingPolicy toAPI(WebCore::SecurityOrigin::StorageBlockingPolicy policy)
198 {
199     switch (policy) {
200     case WebCore::SecurityOrigin::AllowAllStorage:
201         return _WKStorageBlockingPolicyAllowAll;
202     case WebCore::SecurityOrigin::BlockThirdPartyStorage:
203         return _WKStorageBlockingPolicyBlockThirdParty;
204     case WebCore::SecurityOrigin::BlockAllStorage:
205         return _WKStorageBlockingPolicyBlockAll;
206     }
207
208     ASSERT_NOT_REACHED();
209     return _WKStorageBlockingPolicyAllowAll;
210 }
211
212 - (_WKStorageBlockingPolicy)_storageBlockingPolicy
213 {
214     return toAPI(static_cast<WebCore::SecurityOrigin::StorageBlockingPolicy>(_preferences->storageBlockingPolicy()));
215 }
216
217 - (void)_setStorageBlockingPolicy:(_WKStorageBlockingPolicy)policy
218 {
219     _preferences->setStorageBlockingPolicy(toStorageBlockingPolicy(policy));
220 }
221
222 - (BOOL)_offlineApplicationCacheIsEnabled
223 {
224     return _preferences->offlineWebApplicationCacheEnabled();
225 }
226
227 - (void)_setOfflineApplicationCacheIsEnabled:(BOOL)offlineApplicationCacheIsEnabled
228 {
229     _preferences->setOfflineWebApplicationCacheEnabled(offlineApplicationCacheIsEnabled);
230 }
231
232 - (BOOL)_fullScreenEnabled
233 {
234     return _preferences->fullScreenEnabled();
235 }
236
237 - (void)_setFullScreenEnabled:(BOOL)fullScreenEnabled
238 {
239     _preferences->setFullScreenEnabled(fullScreenEnabled);
240 }
241
242 - (BOOL)_allowsPictureInPictureMediaPlayback
243 {
244     return _preferences->allowsPictureInPictureMediaPlayback();
245 }
246
247 - (void)_setAllowsPictureInPictureMediaPlayback:(BOOL)allowed
248 {
249     _preferences->setAllowsPictureInPictureMediaPlayback(allowed);
250 }
251
252 - (BOOL)_compositingBordersVisible
253 {
254     return _preferences->compositingBordersVisible();
255 }
256
257 - (void)_setCompositingBordersVisible:(BOOL)compositingBordersVisible
258 {
259     _preferences->setCompositingBordersVisible(compositingBordersVisible);
260 }
261
262 - (BOOL)_compositingRepaintCountersVisible
263 {
264     return _preferences->compositingRepaintCountersVisible();
265 }
266
267 - (void)_setCompositingRepaintCountersVisible:(BOOL)repaintCountersVisible
268 {
269     _preferences->setCompositingRepaintCountersVisible(repaintCountersVisible);
270 }
271
272 - (BOOL)_tiledScrollingIndicatorVisible
273 {
274     return _preferences->tiledScrollingIndicatorVisible();
275 }
276
277 - (void)_setTiledScrollingIndicatorVisible:(BOOL)tiledScrollingIndicatorVisible
278 {
279     _preferences->setTiledScrollingIndicatorVisible(tiledScrollingIndicatorVisible);
280 }
281
282 - (BOOL)_resourceUsageOverlayVisible
283 {
284     return _preferences->resourceUsageOverlayVisible();
285 }
286
287 - (void)_setResourceUsageOverlayVisible:(BOOL)resourceUsageOverlayVisible
288 {
289     _preferences->setResourceUsageOverlayVisible(resourceUsageOverlayVisible);
290 }
291
292 - (_WKDebugOverlayRegions)_visibleDebugOverlayRegions
293 {
294     return _preferences->visibleDebugOverlayRegions();
295 }
296
297 - (void)_setVisibleDebugOverlayRegions:(_WKDebugOverlayRegions)regionFlags
298 {
299     _preferences->setVisibleDebugOverlayRegions(regionFlags);
300 }
301
302 - (BOOL)_simpleLineLayoutEnabled
303 {
304     return _preferences->simpleLineLayoutEnabled();
305 }
306
307 - (void)_setSimpleLineLayoutEnabled:(BOOL)simpleLineLayoutEnabled
308 {
309     _preferences->setSimpleLineLayoutEnabled(simpleLineLayoutEnabled);
310 }
311
312 - (BOOL)_simpleLineLayoutDebugBordersEnabled
313 {
314     return _preferences->simpleLineLayoutDebugBordersEnabled();
315 }
316
317 - (void)_setSimpleLineLayoutDebugBordersEnabled:(BOOL)simpleLineLayoutDebugBordersEnabled
318 {
319     _preferences->setSimpleLineLayoutDebugBordersEnabled(simpleLineLayoutDebugBordersEnabled);
320 }
321
322 - (BOOL)_contentChangeObserverEnabled
323 {
324     return _preferences->contentChangeObserverEnabled();
325 }
326
327 - (void)_setContentChangeObserverEnabled:(BOOL)contentChangeObserverEnabled
328 {
329     _preferences->setContentChangeObserverEnabled(contentChangeObserverEnabled);
330 }
331
332 - (BOOL)_acceleratedDrawingEnabled
333 {
334     return _preferences->acceleratedDrawingEnabled();
335 }
336
337 - (void)_setAcceleratedDrawingEnabled:(BOOL)acceleratedDrawingEnabled
338 {
339     _preferences->setAcceleratedDrawingEnabled(acceleratedDrawingEnabled);
340 }
341
342 - (BOOL)_displayListDrawingEnabled
343 {
344     return _preferences->displayListDrawingEnabled();
345 }
346
347 - (void)_setDisplayListDrawingEnabled:(BOOL)displayListDrawingEnabled
348 {
349     _preferences->setDisplayListDrawingEnabled(displayListDrawingEnabled);
350 }
351
352 - (BOOL)_largeImageAsyncDecodingEnabled
353 {
354     return _preferences->largeImageAsyncDecodingEnabled();
355 }
356
357 - (void)_setLargeImageAsyncDecodingEnabled:(BOOL)_largeImageAsyncDecodingEnabled
358 {
359     _preferences->setLargeImageAsyncDecodingEnabled(_largeImageAsyncDecodingEnabled);
360 }
361
362 - (BOOL)_animatedImageAsyncDecodingEnabled
363 {
364     return _preferences->animatedImageAsyncDecodingEnabled();
365 }
366
367 - (void)_setAnimatedImageAsyncDecodingEnabled:(BOOL)_animatedImageAsyncDecodingEnabled
368 {
369     _preferences->setAnimatedImageAsyncDecodingEnabled(_animatedImageAsyncDecodingEnabled);
370 }
371
372 - (BOOL)_textAutosizingEnabled
373 {
374     return _preferences->textAutosizingEnabled();
375 }
376
377 - (void)_setTextAutosizingEnabled:(BOOL)enabled
378 {
379     _preferences->setTextAutosizingEnabled(enabled);
380 }
381
382 - (BOOL)_subpixelAntialiasedLayerTextEnabled
383 {
384     return _preferences->subpixelAntialiasedLayerTextEnabled();
385 }
386
387 - (void)_setSubpixelAntialiasedLayerTextEnabled:(BOOL)enabled
388 {
389     _preferences->setSubpixelAntialiasedLayerTextEnabled(enabled);
390 }
391
392 - (BOOL)_developerExtrasEnabled
393 {
394     return _preferences->developerExtrasEnabled();
395 }
396
397 - (void)_setDeveloperExtrasEnabled:(BOOL)developerExtrasEnabled
398 {
399     _preferences->setDeveloperExtrasEnabled(developerExtrasEnabled);
400 }
401
402 - (BOOL)_logsPageMessagesToSystemConsoleEnabled
403 {
404     return _preferences->logsPageMessagesToSystemConsoleEnabled();
405 }
406
407 - (void)_setLogsPageMessagesToSystemConsoleEnabled:(BOOL)logsPageMessagesToSystemConsoleEnabled
408 {
409     _preferences->setLogsPageMessagesToSystemConsoleEnabled(logsPageMessagesToSystemConsoleEnabled);
410 }
411
412 - (BOOL)_hiddenPageDOMTimerThrottlingEnabled
413 {
414     return _preferences->hiddenPageDOMTimerThrottlingEnabled();
415 }
416
417 - (void)_setHiddenPageDOMTimerThrottlingEnabled:(BOOL)hiddenPageDOMTimerThrottlingEnabled
418 {
419     _preferences->setHiddenPageDOMTimerThrottlingEnabled(hiddenPageDOMTimerThrottlingEnabled);
420 }
421
422 - (BOOL)_hiddenPageDOMTimerThrottlingAutoIncreases
423 {
424     return _preferences->hiddenPageDOMTimerThrottlingAutoIncreases();
425 }
426
427 - (void)_setHiddenPageDOMTimerThrottlingAutoIncreases:(BOOL)hiddenPageDOMTimerThrottlingAutoIncreases
428 {
429     _preferences->setHiddenPageDOMTimerThrottlingAutoIncreases(hiddenPageDOMTimerThrottlingAutoIncreases);
430 }
431
432 - (BOOL)_pageVisibilityBasedProcessSuppressionEnabled
433 {
434     return _preferences->pageVisibilityBasedProcessSuppressionEnabled();
435 }
436
437 - (void)_setPageVisibilityBasedProcessSuppressionEnabled:(BOOL)pageVisibilityBasedProcessSuppressionEnabled
438 {
439     _preferences->setPageVisibilityBasedProcessSuppressionEnabled(pageVisibilityBasedProcessSuppressionEnabled);
440 }
441
442 - (BOOL)_allowFileAccessFromFileURLs
443 {
444     return _preferences->allowFileAccessFromFileURLs();
445 }
446
447 - (void)_setAllowFileAccessFromFileURLs:(BOOL)allowFileAccessFromFileURLs
448 {
449     _preferences->setAllowFileAccessFromFileURLs(allowFileAccessFromFileURLs);
450 }
451
452 - (_WKJavaScriptRuntimeFlags)_javaScriptRuntimeFlags
453 {
454     return _preferences->javaScriptRuntimeFlags();
455 }
456
457 - (void)_setJavaScriptRuntimeFlags:(_WKJavaScriptRuntimeFlags)javaScriptRuntimeFlags
458 {
459     _preferences->setJavaScriptRuntimeFlags(javaScriptRuntimeFlags);
460 }
461
462 - (BOOL)_isStandalone
463 {
464     return _preferences->standalone();
465 }
466
467 - (void)_setStandalone:(BOOL)standalone
468 {
469     _preferences->setStandalone(standalone);
470 }
471
472 - (BOOL)_diagnosticLoggingEnabled
473 {
474     return _preferences->diagnosticLoggingEnabled();
475 }
476
477 - (void)_setDiagnosticLoggingEnabled:(BOOL)diagnosticLoggingEnabled
478 {
479     _preferences->setDiagnosticLoggingEnabled(diagnosticLoggingEnabled);
480 }
481
482 - (NSUInteger)_defaultFontSize
483 {
484     return _preferences->defaultFontSize();
485 }
486
487 - (void)_setDefaultFontSize:(NSUInteger)defaultFontSize
488 {
489     _preferences->setDefaultFontSize(defaultFontSize);
490 }
491
492 - (NSUInteger)_defaultFixedPitchFontSize
493 {
494     return _preferences->defaultFixedFontSize();
495 }
496
497 - (void)_setDefaultFixedPitchFontSize:(NSUInteger)defaultFixedPitchFontSize
498 {
499     _preferences->setDefaultFixedFontSize(defaultFixedPitchFontSize);
500 }
501
502 - (NSString *)_fixedPitchFontFamily
503 {
504     return _preferences->fixedFontFamily();
505 }
506
507 - (void)_setFixedPitchFontFamily:(NSString *)fixedPitchFontFamily
508 {
509     _preferences->setFixedFontFamily(fixedPitchFontFamily);
510 }
511
512 + (NSArray<_WKInternalDebugFeature *> *)_internalDebugFeatures
513 {
514     auto features = WebKit::WebPreferences::internalDebugFeatures();
515     return wrapper(API::Array::create(WTFMove(features)));
516 }
517
518 - (BOOL)_isEnabledForInternalDebugFeature:(_WKInternalDebugFeature *)feature
519 {
520     return _preferences->isFeatureEnabled(*feature->_internalDebugFeature);
521 }
522
523 - (void)_setEnabled:(BOOL)value forInternalDebugFeature:(_WKInternalDebugFeature *)feature
524 {
525     _preferences->setFeatureEnabled(*feature->_internalDebugFeature, value);
526 }
527
528 + (NSArray<_WKExperimentalFeature *> *)_experimentalFeatures
529 {
530     auto features = WebKit::WebPreferences::experimentalFeatures();
531     return wrapper(API::Array::create(WTFMove(features)));
532 }
533
534 // FIXME: Remove this once Safari has adopted the new API.
535 - (BOOL)_isEnabledForFeature:(_WKExperimentalFeature *)feature
536 {
537     return [self _isEnabledForExperimentalFeature:feature];
538 }
539
540 // FIXME: Remove this once Safari has adopted the new API.
541 - (void)_setEnabled:(BOOL)value forFeature:(_WKExperimentalFeature *)feature
542 {
543     [self _setEnabled:value forExperimentalFeature:feature];
544 }
545
546 - (BOOL)_isEnabledForExperimentalFeature:(_WKExperimentalFeature *)feature
547 {
548     return _preferences->isFeatureEnabled(*feature->_experimentalFeature);
549 }
550
551 - (void)_setEnabled:(BOOL)value forExperimentalFeature:(_WKExperimentalFeature *)feature
552 {
553     _preferences->setFeatureEnabled(*feature->_experimentalFeature, value);
554 }
555
556 - (BOOL)_applePayCapabilityDisclosureAllowed
557 {
558 #if ENABLE(APPLE_PAY)
559     return _preferences->applePayCapabilityDisclosureAllowed();
560 #else
561     return NO;
562 #endif
563 }
564
565 - (void)_setApplePayCapabilityDisclosureAllowed:(BOOL)applePayCapabilityDisclosureAllowed
566 {
567 #if ENABLE(APPLE_PAY)
568     _preferences->setApplePayCapabilityDisclosureAllowed(applePayCapabilityDisclosureAllowed);
569 #endif
570 }
571
572 - (BOOL)_shouldSuppressKeyboardInputDuringProvisionalNavigation
573 {
574     return _preferences->shouldSuppressTextInputFromEditingDuringProvisionalNavigation();
575 }
576
577 - (void)_setShouldSuppressKeyboardInputDuringProvisionalNavigation:(BOOL)shouldSuppress
578 {
579     _preferences->setShouldSuppressTextInputFromEditingDuringProvisionalNavigation(shouldSuppress);
580 }
581
582 - (BOOL)_loadsImagesAutomatically
583 {
584     return _preferences->loadsImagesAutomatically();
585 }
586
587 - (void)_setLoadsImagesAutomatically:(BOOL)loadsImagesAutomatically
588 {
589     _preferences->setLoadsImagesAutomatically(loadsImagesAutomatically);
590 }
591
592 - (BOOL)_peerConnectionEnabled
593 {
594     return _preferences->peerConnectionEnabled();
595 }
596
597 - (void)_setPeerConnectionEnabled:(BOOL)enabled
598 {
599     _preferences->setPeerConnectionEnabled(enabled);
600 }
601
602 - (BOOL)_mediaDevicesEnabled
603 {
604     return _preferences->mediaDevicesEnabled();
605 }
606
607 - (void)_setMediaDevicesEnabled:(BOOL)enabled
608 {
609     _preferences->setMediaDevicesEnabled(enabled);
610 }
611
612 - (BOOL)_screenCaptureEnabled
613 {
614     return _preferences->screenCaptureEnabled();
615 }
616
617 - (void)_setScreenCaptureEnabled:(BOOL)enabled
618 {
619     _preferences->setScreenCaptureEnabled(enabled);
620 }
621
622 - (BOOL)_mockCaptureDevicesEnabled
623 {
624     return _preferences->mockCaptureDevicesEnabled();
625 }
626
627 - (void)_setMockCaptureDevicesEnabled:(BOOL)enabled
628 {
629     _preferences->setMockCaptureDevicesEnabled(enabled);
630 }
631
632 - (BOOL)_mockCaptureDevicesPromptEnabled
633 {
634     return _preferences->mockCaptureDevicesPromptEnabled();
635 }
636
637 - (void)_setMockCaptureDevicesPromptEnabled:(BOOL)enabled
638 {
639     _preferences->setMockCaptureDevicesPromptEnabled(enabled);
640 }
641
642 - (BOOL)_mediaCaptureRequiresSecureConnection
643 {
644     return _preferences->mediaCaptureRequiresSecureConnection();
645 }
646
647 - (void)_setMediaCaptureRequiresSecureConnection:(BOOL)requiresSecureConnection
648 {
649     _preferences->setMediaCaptureRequiresSecureConnection(requiresSecureConnection);
650 }
651
652 - (double)_inactiveMediaCaptureSteamRepromptIntervalInMinutes
653 {
654     return _preferences->inactiveMediaCaptureSteamRepromptIntervalInMinutes();
655 }
656
657 - (void)_setInactiveMediaCaptureSteamRepromptIntervalInMinutes:(double)interval
658 {
659     _preferences->setInactiveMediaCaptureSteamRepromptIntervalInMinutes(interval);
660 }
661
662 - (BOOL)_interruptAudioOnPageVisibilityChangeEnabled
663 {
664     return _preferences->interruptAudioOnPageVisibilityChangeEnabled();
665 }
666
667 - (void)_setInterruptAudioOnPageVisibilityChangeEnabled:(BOOL)enabled
668 {
669     _preferences->setInterruptAudioOnPageVisibilityChangeEnabled(enabled);
670 }
671
672 - (BOOL)_enumeratingAllNetworkInterfacesEnabled
673 {
674     return _preferences->enumeratingAllNetworkInterfacesEnabled();
675 }
676
677 - (void)_setEnumeratingAllNetworkInterfacesEnabled:(BOOL)enabled
678 {
679     _preferences->setEnumeratingAllNetworkInterfacesEnabled(enabled);
680 }
681
682 - (BOOL)_iceCandidateFilteringEnabled
683 {
684     return _preferences->iceCandidateFilteringEnabled();
685 }
686
687 - (void)_setICECandidateFilteringEnabled:(BOOL)enabled
688 {
689     _preferences->setICECandidateFilteringEnabled(enabled);
690 }
691
692 - (BOOL)_webRTCLegacyAPIEnabled
693 {
694     return NO;
695 }
696
697 - (void)_setWebRTCLegacyAPIEnabled:(BOOL)enabled
698 {
699 }
700
701 - (void)_setJavaScriptCanAccessClipboard:(BOOL)javaScriptCanAccessClipboard
702 {
703     _preferences->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
704 }
705
706 - (BOOL)_shouldAllowUserInstalledFonts
707 {
708     return _preferences->shouldAllowUserInstalledFonts();
709 }
710
711 - (void)_setShouldAllowUserInstalledFonts:(BOOL)_shouldAllowUserInstalledFonts
712 {
713     _preferences->setShouldAllowUserInstalledFonts(_shouldAllowUserInstalledFonts);
714 }
715
716 - (BOOL)_shouldAllowDesignSystemUIFonts
717 {
718     return _preferences->shouldAllowDesignSystemUIFonts();
719 }
720
721 - (void)_setShouldAllowDesignSystemUIFonts:(BOOL)_shouldAllowDesignSystemUIFonts
722 {
723     _preferences->setShouldAllowDesignSystemUIFonts(_shouldAllowDesignSystemUIFonts);
724 }
725
726 static _WKEditableLinkBehavior toAPI(WebCore::EditableLinkBehavior behavior)
727 {
728     switch (behavior) {
729     case WebCore::EditableLinkDefaultBehavior:
730         return _WKEditableLinkBehaviorDefault;
731     case WebCore::EditableLinkAlwaysLive:
732         return _WKEditableLinkBehaviorAlwaysLive;
733     case WebCore::EditableLinkOnlyLiveWithShiftKey:
734         return _WKEditableLinkBehaviorOnlyLiveWithShiftKey;
735     case WebCore::EditableLinkLiveWhenNotFocused:
736         return _WKEditableLinkBehaviorLiveWhenNotFocused;
737     case WebCore::EditableLinkNeverLive:
738         return _WKEditableLinkBehaviorNeverLive;
739     }
740     
741     ASSERT_NOT_REACHED();
742     return _WKEditableLinkBehaviorNeverLive;
743 }
744
745 static WebCore::EditableLinkBehavior toEditableLinkBehavior(_WKEditableLinkBehavior wkBehavior)
746 {
747     switch (wkBehavior) {
748     case _WKEditableLinkBehaviorDefault:
749         return WebCore::EditableLinkDefaultBehavior;
750     case _WKEditableLinkBehaviorAlwaysLive:
751         return WebCore::EditableLinkAlwaysLive;
752     case _WKEditableLinkBehaviorOnlyLiveWithShiftKey:
753         return WebCore::EditableLinkOnlyLiveWithShiftKey;
754     case _WKEditableLinkBehaviorLiveWhenNotFocused:
755         return WebCore::EditableLinkLiveWhenNotFocused;
756     case _WKEditableLinkBehaviorNeverLive:
757         return WebCore::EditableLinkNeverLive;
758     }
759     
760     ASSERT_NOT_REACHED();
761     return WebCore::EditableLinkNeverLive;
762 }
763
764 - (_WKEditableLinkBehavior)_editableLinkBehavior
765 {
766     return toAPI(static_cast<WebCore::EditableLinkBehavior>(_preferences->editableLinkBehavior()));
767 }
768
769 - (void)_setEditableLinkBehavior:(_WKEditableLinkBehavior)editableLinkBehavior
770 {
771     _preferences->setEditableLinkBehavior(toEditableLinkBehavior(editableLinkBehavior));
772 }
773
774 - (void)_setAVFoundationEnabled:(BOOL)enabled
775 {
776     _preferences->setAVFoundationEnabled(enabled);
777 }
778
779 - (BOOL)_avFoundationEnabled
780 {
781     return _preferences->isAVFoundationEnabled();
782 }
783
784 - (void)_setColorFilterEnabled:(BOOL)enabled
785 {
786     _preferences->setColorFilterEnabled(enabled);
787 }
788
789 - (BOOL)_colorFilterEnabled
790 {
791     return _preferences->colorFilterEnabled();
792 }
793
794 - (void)_setPunchOutWhiteBackgroundsInDarkMode:(BOOL)punches
795 {
796     _preferences->setPunchOutWhiteBackgroundsInDarkMode(punches);
797 }
798
799 - (BOOL)_punchOutWhiteBackgroundsInDarkMode
800 {
801     return _preferences->punchOutWhiteBackgroundsInDarkMode();
802 }
803
804 - (void)_setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled
805 {
806     _preferences->setLowPowerVideoAudioBufferSizeEnabled(enabled);
807 }
808
809 - (BOOL)_lowPowerVideoAudioBufferSizeEnabled
810 {
811     return _preferences->lowPowerVideoAudioBufferSizeEnabled();
812 }
813
814 - (void)_setShouldIgnoreMetaViewport:(BOOL)ignoreMetaViewport
815 {
816     return _preferences->setShouldIgnoreMetaViewport(ignoreMetaViewport);
817 }
818
819 - (BOOL)_shouldIgnoreMetaViewport
820 {
821     return _preferences->shouldIgnoreMetaViewport();
822 }
823
824 - (void)_setNeedsSiteSpecificQuirks:(BOOL)enabled
825 {
826     _preferences->setNeedsSiteSpecificQuirks(enabled);
827 }
828
829 - (BOOL)_needsSiteSpecificQuirks
830 {
831     return _preferences->needsSiteSpecificQuirks();
832 }
833
834 - (void)_setItpDebugModeEnabled:(BOOL)enabled
835 {
836     _preferences->setItpDebugModeEnabled(enabled);
837 }
838
839 - (BOOL)_itpDebugModeEnabled
840 {
841     return _preferences->itpDebugModeEnabled();
842 }
843
844 - (void)_setMediaSourceEnabled:(BOOL)enabled
845 {
846     _preferences->setMediaSourceEnabled(enabled);
847 }
848
849 - (BOOL)_mediaSourceEnabled
850 {
851     return _preferences->mediaSourceEnabled();
852 }
853
854 #if PLATFORM(MAC)
855 - (void)_setJavaEnabledForLocalFiles:(BOOL)enabled
856 {
857     _preferences->setJavaEnabledForLocalFiles(enabled);
858 }
859
860 - (BOOL)_javaEnabledForLocalFiles
861 {
862     return _preferences->javaEnabledForLocalFiles();
863 }
864
865 - (void)_setCanvasUsesAcceleratedDrawing:(BOOL)enabled
866 {
867     _preferences->setCanvasUsesAcceleratedDrawing(enabled);
868 }
869
870 - (BOOL)_canvasUsesAcceleratedDrawing
871 {
872     return _preferences->canvasUsesAcceleratedDrawing();
873 }
874
875 - (void)_setAcceleratedCompositingEnabled:(BOOL)enabled
876 {
877     _preferences->setAcceleratedCompositingEnabled(enabled);
878 }
879
880 - (BOOL)_acceleratedCompositingEnabled
881 {
882     return _preferences->acceleratedCompositingEnabled();
883 }
884
885 - (void)_setDefaultTextEncodingName:(NSString *)name
886 {
887     _preferences->setDefaultTextEncodingName(name);
888 }
889
890 - (NSString *)_defaultTextEncodingName
891 {
892     return _preferences->defaultTextEncodingName();
893 }
894
895 - (void)_setAuthorAndUserStylesEnabled:(BOOL)enabled
896 {
897     _preferences->setAuthorAndUserStylesEnabled(enabled);
898 }
899
900 - (BOOL)_authorAndUserStylesEnabled
901 {
902     return _preferences->authorAndUserStylesEnabled();
903 }
904
905 - (void)_setDOMTimersThrottlingEnabled:(BOOL)enabled
906 {
907     _preferences->setDOMTimersThrottlingEnabled(enabled);
908 }
909
910 - (BOOL)_domTimersThrottlingEnabled
911 {
912     return _preferences->domTimersThrottlingEnabled();
913 }
914
915 - (void)_setWebArchiveDebugModeEnabled:(BOOL)enabled
916 {
917     _preferences->setWebArchiveDebugModeEnabled(enabled);
918 }
919
920 - (BOOL)_webArchiveDebugModeEnabled
921 {
922     return _preferences->webArchiveDebugModeEnabled();
923 }
924
925 - (void)_setLocalFileContentSniffingEnabled:(BOOL)enabled
926 {
927     _preferences->setLocalFileContentSniffingEnabled(enabled);
928 }
929
930 - (BOOL)_localFileContentSniffingEnabled
931 {
932     return _preferences->localFileContentSniffingEnabled();
933 }
934
935 - (void)_setUsesPageCache:(BOOL)enabled
936 {
937     _preferences->setUsesPageCache(enabled);
938 }
939
940 - (BOOL)_usesPageCache
941 {
942     return _preferences->usesPageCache();
943 }
944
945 - (void)_setPageCacheSupportsPlugins:(BOOL)enabled
946 {
947     _preferences->setPageCacheSupportsPlugins(enabled);
948 }
949
950 - (BOOL)_pageCacheSupportsPlugins
951 {
952     return _preferences->pageCacheSupportsPlugins();
953 }
954
955 - (void)_setShouldPrintBackgrounds:(BOOL)enabled
956 {
957     _preferences->setShouldPrintBackgrounds(enabled);
958 }
959
960 - (BOOL)_shouldPrintBackgrounds
961 {
962     return _preferences->shouldPrintBackgrounds();
963 }
964
965 - (void)_setWebSecurityEnabled:(BOOL)enabled
966 {
967     _preferences->setWebSecurityEnabled(enabled);
968 }
969
970 - (BOOL)_webSecurityEnabled
971 {
972     return _preferences->webSecurityEnabled();
973 }
974
975 - (void)_setUniversalAccessFromFileURLsAllowed:(BOOL)enabled
976 {
977     _preferences->setAllowUniversalAccessFromFileURLs(enabled);
978 }
979
980 - (BOOL)_universalAccessFromFileURLsAllowed
981 {
982     return _preferences->allowUniversalAccessFromFileURLs();
983 }
984
985 - (void)_setSuppressesIncrementalRendering:(BOOL)enabled
986 {
987     _preferences->setSuppressesIncrementalRendering(enabled);
988 }
989
990 - (BOOL)_suppressesIncrementalRendering
991 {
992     return _preferences->suppressesIncrementalRendering();
993 }
994
995 - (void)_setAsynchronousPluginInitializationEnabled:(BOOL)enabled
996 {
997     _preferences->setAsynchronousPluginInitializationEnabled(enabled);
998 }
999
1000 - (BOOL)_asynchronousPluginInitializationEnabled
1001 {
1002     return _preferences->asynchronousPluginInitializationEnabled();
1003 }
1004
1005 - (void)_setArtificialPluginInitializationDelayEnabled:(BOOL)enabled
1006 {
1007     _preferences->setArtificialPluginInitializationDelayEnabled(enabled);
1008 }
1009
1010 - (BOOL)_artificialPluginInitializationDelayEnabled
1011 {
1012     return _preferences->artificialPluginInitializationDelayEnabled();
1013 }
1014
1015 - (void)_setExperimentalPlugInSandboxProfilesEnabled:(BOOL)enabled
1016 {
1017 #if ENABLE(NETSCAPE_PLUGIN_API)
1018     WebKit::PluginProcessManager::singleton().setExperimentalPlugInSandboxProfilesEnabled(enabled);
1019 #endif
1020     _preferences->setExperimentalPlugInSandboxProfilesEnabled(enabled);
1021 }
1022
1023 - (BOOL)_experimentalPlugInSandboxProfilesEnabled
1024 {
1025     return _preferences->experimentalPlugInSandboxProfilesEnabled();
1026 }
1027
1028 - (void)_setCookieEnabled:(BOOL)enabled
1029 {
1030     _preferences->setCookieEnabled(enabled);
1031 }
1032
1033 - (BOOL)_cookieEnabled
1034 {
1035     return _preferences->cookieEnabled();
1036 }
1037
1038 - (void)_setPlugInSnapshottingEnabled:(BOOL)enabled
1039 {
1040     _preferences->setPlugInSnapshottingEnabled(enabled);
1041 }
1042
1043 - (BOOL)_plugInSnapshottingEnabled
1044 {
1045     return _preferences->plugInSnapshottingEnabled();
1046 }
1047
1048 - (void)_setSubpixelCSSOMElementMetricsEnabled:(BOOL)enabled
1049 {
1050     _preferences->setSubpixelCSSOMElementMetricsEnabled(enabled);
1051 }
1052
1053 - (BOOL)_subpixelCSSOMElementMetricsEnabled
1054 {
1055     return _preferences->subpixelCSSOMElementMetricsEnabled();
1056 }
1057
1058 - (void)_setViewGestureDebuggingEnabled:(BOOL)enabled
1059 {
1060     _preferences->setViewGestureDebuggingEnabled(enabled);
1061 }
1062
1063 - (BOOL)_viewGestureDebuggingEnabled
1064 {
1065     return _preferences->viewGestureDebuggingEnabled();
1066 }
1067
1068 - (void)_setStandardFontFamily:(NSString *)family
1069 {
1070     _preferences->setStandardFontFamily(family);
1071 }
1072
1073 - (NSString *)_standardFontFamily
1074 {
1075     return _preferences->standardFontFamily();
1076 }
1077
1078 - (void)_setNotificationsEnabled:(BOOL)enabled
1079 {
1080     _preferences->setNotificationsEnabled(enabled);
1081 }
1082
1083 - (BOOL)_notificationsEnabled
1084 {
1085     return _preferences->notificationsEnabled();
1086 }
1087
1088 - (void)_setBackspaceKeyNavigationEnabled:(BOOL)enabled
1089 {
1090     _preferences->setBackspaceKeyNavigationEnabled(enabled);
1091 }
1092
1093 - (BOOL)_backspaceKeyNavigationEnabled
1094 {
1095     return _preferences->backspaceKeyNavigationEnabled();
1096 }
1097
1098 - (void)_setWebGLEnabled:(BOOL)enabled
1099 {
1100     _preferences->setWebGLEnabled(enabled);
1101 }
1102
1103 - (BOOL)_webGLEnabled
1104 {
1105     return _preferences->webGLEnabled();
1106 }
1107
1108 - (void)_setAllowsInlineMediaPlayback:(BOOL)enabled
1109 {
1110     _preferences->setAllowsInlineMediaPlayback(enabled);
1111 }
1112
1113 - (BOOL)_allowsInlineMediaPlayback
1114 {
1115     return _preferences->allowsInlineMediaPlayback();
1116 }
1117
1118 - (void)_setApplePayEnabled:(BOOL)enabled
1119 {
1120     _preferences->setApplePayEnabled(enabled);
1121 }
1122
1123 - (BOOL)_applePayEnabled
1124 {
1125     return _preferences->applePayEnabled();
1126 }
1127
1128 - (void)_setDNSPrefetchingEnabled:(BOOL)enabled
1129 {
1130     _preferences->setDNSPrefetchingEnabled(enabled);
1131 }
1132
1133 - (BOOL)_dnsPrefetchingEnabled
1134 {
1135     return _preferences->dnsPrefetchingEnabled();
1136 }
1137
1138 - (void)_setInlineMediaPlaybackRequiresPlaysInlineAttribute:(BOOL)enabled
1139 {
1140     _preferences->setInlineMediaPlaybackRequiresPlaysInlineAttribute(enabled);
1141 }
1142
1143 - (BOOL)_inlineMediaPlaybackRequiresPlaysInlineAttribute
1144 {
1145     return _preferences->inlineMediaPlaybackRequiresPlaysInlineAttribute();
1146 }
1147
1148 - (void)_setInvisibleMediaAutoplayNotPermitted:(BOOL)enabled
1149 {
1150     _preferences->setInvisibleAutoplayNotPermitted(enabled);
1151 }
1152
1153 - (BOOL)_invisibleMediaAutoplayNotPermitted
1154 {
1155     return _preferences->invisibleAutoplayNotPermitted();
1156 }
1157
1158 - (void)_setLegacyEncryptedMediaAPIEnabled:(BOOL)enabled
1159 {
1160     _preferences->setLegacyEncryptedMediaAPIEnabled(enabled);
1161 }
1162
1163 - (BOOL)_legacyEncryptedMediaAPIEnabled
1164 {
1165     return _preferences->legacyEncryptedMediaAPIEnabled();
1166 }
1167
1168 - (void)_setMainContentUserGestureOverrideEnabled:(BOOL)enabled
1169 {
1170     _preferences->setMainContentUserGestureOverrideEnabled(enabled);
1171 }
1172
1173 - (BOOL)_mainContentUserGestureOverrideEnabled
1174 {
1175     return _preferences->mainContentUserGestureOverrideEnabled();
1176 }
1177
1178 - (void)_setMediaStreamEnabled:(BOOL)enabled
1179 {
1180     _preferences->setMediaStreamEnabled(enabled);
1181 }
1182
1183 - (BOOL)_mediaStreamEnabled
1184 {
1185     return _preferences->mediaStreamEnabled();
1186 }
1187
1188 - (void)_setNeedsStorageAccessFromFileURLsQuirk:(BOOL)enabled
1189 {
1190     _preferences->setNeedsStorageAccessFromFileURLsQuirk(enabled);
1191 }
1192
1193 - (BOOL)_needsStorageAccessFromFileURLsQuirk
1194 {
1195     return _preferences->needsStorageAccessFromFileURLsQuirk();
1196 }
1197
1198 - (void)_setPDFPluginEnabled:(BOOL)enabled
1199 {
1200     _preferences->setPDFPluginEnabled(enabled);
1201 }
1202
1203 - (BOOL)_pdfPluginEnabled
1204 {
1205     return _preferences->pdfPluginEnabled();
1206 }
1207
1208 - (void)_setRequiresUserGestureForAudioPlayback:(BOOL)enabled
1209 {
1210     _preferences->setRequiresUserGestureForAudioPlayback(enabled);
1211 }
1212
1213 - (BOOL)_requiresUserGestureForAudioPlayback
1214 {
1215     return _preferences->requiresUserGestureForAudioPlayback();
1216 }
1217
1218 - (void)_setRequiresUserGestureForVideoPlayback:(BOOL)enabled
1219 {
1220     _preferences->setRequiresUserGestureForVideoPlayback(enabled);
1221 }
1222
1223 - (BOOL)_requiresUserGestureForVideoPlayback
1224 {
1225     return _preferences->requiresUserGestureForVideoPlayback();
1226 }
1227
1228 - (void)_setServiceControlsEnabled:(BOOL)enabled
1229 {
1230     _preferences->setServiceControlsEnabled(enabled);
1231 }
1232
1233 - (BOOL)_serviceControlsEnabled
1234 {
1235     return _preferences->serviceControlsEnabled();
1236 }
1237
1238 - (void)_setShowsToolTipOverTruncatedText:(BOOL)enabled
1239 {
1240     _preferences->setShowsToolTipOverTruncatedText(enabled);
1241 }
1242
1243 - (BOOL)_showsToolTipOverTruncatedText
1244 {
1245     return _preferences->showsToolTipOverTruncatedText();
1246 }
1247
1248 - (void)_setTextAreasAreResizable:(BOOL)enabled
1249 {
1250     _preferences->setTextAreasAreResizable(enabled);
1251 }
1252
1253 - (BOOL)_textAreasAreResizable
1254 {
1255     return _preferences->textAreasAreResizable();
1256 }
1257
1258 - (void)_setUseGiantTiles:(BOOL)enabled
1259 {
1260     _preferences->setUseGiantTiles(enabled);
1261 }
1262
1263 - (BOOL)_useGiantTiles
1264 {
1265     return _preferences->useGiantTiles();
1266 }
1267
1268 - (void)_setWantsBalancedSetDefersLoadingBehavior:(BOOL)enabled
1269 {
1270     _preferences->setWantsBalancedSetDefersLoadingBehavior(enabled);
1271 }
1272
1273 - (BOOL)_wantsBalancedSetDefersLoadingBehavior
1274 {
1275     return _preferences->wantsBalancedSetDefersLoadingBehavior();
1276 }
1277
1278 - (void)_setWebAudioEnabled:(BOOL)enabled
1279 {
1280     _preferences->setWebAudioEnabled(enabled);
1281 }
1282
1283 - (BOOL)_webAudioEnabled
1284 {
1285     return _preferences->webAudioEnabled();
1286 }
1287
1288 - (void)_setAggressiveTileRetentionEnabled:(BOOL)enabled
1289 {
1290     _preferences->setAggressiveTileRetentionEnabled(enabled);
1291 }
1292
1293 - (BOOL)_aggressiveTileRetentionEnabled
1294 {
1295     return _preferences->aggressiveTileRetentionEnabled();
1296 }
1297
1298 - (void)_setAppNapEnabled:(BOOL)enabled
1299 {
1300     _preferences->setPageVisibilityBasedProcessSuppressionEnabled(enabled);
1301 }
1302
1303 - (BOOL)_appNapEnabled
1304 {
1305     return _preferences->pageVisibilityBasedProcessSuppressionEnabled();
1306 }
1307
1308 #endif // PLATFORM(MAC)
1309
1310 - (BOOL)_javaScriptCanAccessClipboard
1311 {
1312     return _preferences->javaScriptCanAccessClipboard();
1313 }
1314
1315 - (void)_setDOMPasteAllowed:(BOOL)domPasteAllowed
1316 {
1317     _preferences->setDOMPasteAllowed(domPasteAllowed);
1318 }
1319
1320 - (BOOL)_domPasteAllowed
1321 {
1322     return _preferences->domPasteAllowed();
1323 }
1324
1325 - (void)_setShouldEnableTextAutosizingBoost:(BOOL)shouldEnableTextAutosizingBoost
1326 {
1327 #if ENABLE(TEXT_AUTOSIZING)
1328     _preferences->setShouldEnableTextAutosizingBoost(shouldEnableTextAutosizingBoost);
1329 #endif
1330 }
1331
1332 - (BOOL)_shouldEnableTextAutosizingBoost
1333 {
1334 #if ENABLE(TEXT_AUTOSIZING)
1335     return _preferences->shouldEnableTextAutosizingBoost();
1336 #else
1337     return NO;
1338 #endif
1339 }
1340
1341 - (BOOL)_isSafeBrowsingEnabled
1342 {
1343     return _preferences->safeBrowsingEnabled();
1344 }
1345
1346 - (void)_setSafeBrowsingEnabled:(BOOL)enabled
1347 {
1348     _preferences->setSafeBrowsingEnabled(enabled);
1349 }
1350
1351 - (void)_setVideoQualityIncludesDisplayCompositingEnabled:(BOOL)videoQualityIncludesDisplayCompositingEnabled
1352 {
1353     _preferences->setVideoQualityIncludesDisplayCompositingEnabled(videoQualityIncludesDisplayCompositingEnabled);
1354 }
1355
1356 - (BOOL)_videoQualityIncludesDisplayCompositingEnabled
1357 {
1358     return _preferences->videoQualityIncludesDisplayCompositingEnabled();
1359 }
1360
1361 - (void)_setWebAnimationsCSSIntegrationEnabled:(BOOL)enabled
1362 {
1363     _preferences->setWebAnimationsCSSIntegrationEnabled(enabled);
1364 }
1365
1366 - (BOOL)_webAnimationsCSSIntegrationEnabled
1367 {
1368     return _preferences->webAnimationsCSSIntegrationEnabled();
1369 }
1370
1371 - (void)_setDeviceOrientationEventEnabled:(BOOL)enabled
1372 {
1373 #if ENABLE(DEVICE_ORIENTATION)
1374     _preferences->setDeviceOrientationEventEnabled(enabled);
1375 #endif
1376 }
1377
1378 - (BOOL)_deviceOrientationEventEnabled
1379 {
1380 #if ENABLE(DEVICE_ORIENTATION)
1381     return _preferences->deviceOrientationEventEnabled();
1382 #else
1383     return false;
1384 #endif
1385 }
1386
1387 @end
1388
1389 #if !TARGET_OS_IPHONE
1390
1391 @implementation WKPreferences (WKDeprecated)
1392
1393 - (BOOL)javaEnabled
1394 {
1395     return _preferences->javaEnabled();
1396 }
1397
1398 - (void)setJavaEnabled:(BOOL)javaEnabled
1399 {
1400     _preferences->setJavaEnabled(javaEnabled);
1401 }
1402
1403 - (BOOL)plugInsEnabled
1404 {
1405     return _preferences->pluginsEnabled();
1406 }
1407
1408 - (void)setPlugInsEnabled:(BOOL)plugInsEnabled
1409 {
1410     _preferences->setPluginsEnabled(plugInsEnabled);
1411 }
1412
1413 @end
1414
1415 #endif