LEFT | RIGHT |
1 /* | 1 /* |
2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010-2016 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 preferences._compositingRepaintCountersVisible = settings.layerBordersVisibl
e; | 401 preferences._compositingRepaintCountersVisible = settings.layerBordersVisibl
e; |
402 preferences._simpleLineLayoutEnabled = settings.simpleLineLayoutEnabled; | 402 preferences._simpleLineLayoutEnabled = settings.simpleLineLayoutEnabled; |
403 preferences._simpleLineLayoutDebugBordersEnabled = settings.simpleLineLayout
DebugBordersEnabled; | 403 preferences._simpleLineLayoutDebugBordersEnabled = settings.simpleLineLayout
DebugBordersEnabled; |
404 preferences._acceleratedDrawingEnabled = settings.acceleratedDrawingEnabled; | 404 preferences._acceleratedDrawingEnabled = settings.acceleratedDrawingEnabled; |
405 preferences._resourceUsageOverlayVisible = settings.resourceUsageOverlayVisi
ble; | 405 preferences._resourceUsageOverlayVisible = settings.resourceUsageOverlayVisi
ble; |
406 preferences._displayListDrawingEnabled = settings.displayListDrawingEnabled; | 406 preferences._displayListDrawingEnabled = settings.displayListDrawingEnabled; |
407 preferences._subpixelAntialiasedLayerTextEnabled = settings.subpixelAntialia
sedLayerTextEnabled; | 407 preferences._subpixelAntialiasedLayerTextEnabled = settings.subpixelAntialia
sedLayerTextEnabled; |
408 preferences._visualViewportEnabled = settings.visualViewportEnabled; | 408 preferences._visualViewportEnabled = settings.visualViewportEnabled; |
409 preferences._largeImageAsyncDecodingEnabled = settings.largeImageAsyncDecodi
ngEnabled; | 409 preferences._largeImageAsyncDecodingEnabled = settings.largeImageAsyncDecodi
ngEnabled; |
410 preferences._animatedImageAsyncDecodingEnabled = settings.animatedImageAsync
DecodingEnabled; | 410 preferences._animatedImageAsyncDecodingEnabled = settings.animatedImageAsync
DecodingEnabled; |
| 411 preferences.safeBrowsingEnabled = settings.safeBrowsingEnabled; |
411 | 412 |
412 _webView.configuration.websiteDataStore._resourceLoadStatisticsEnabled = set
tings.resourceLoadStatisticsEnabled; | 413 _webView.configuration.websiteDataStore._resourceLoadStatisticsEnabled = set
tings.resourceLoadStatisticsEnabled; |
413 | 414 |
414 BOOL useTransparentWindows = settings.useTransparentWindows; | 415 BOOL useTransparentWindows = settings.useTransparentWindows; |
415 if (useTransparentWindows != !_webView._drawsBackground) { | 416 if (useTransparentWindows != !_webView._drawsBackground) { |
416 [self.window setOpaque:!useTransparentWindows]; | 417 [self.window setOpaque:!useTransparentWindows]; |
417 [self.window setBackgroundColor:[NSColor clearColor]]; | 418 [self.window setBackgroundColor:[NSColor clearColor]]; |
418 [self.window setHasShadow:!useTransparentWindows]; | 419 [self.window setHasShadow:!useTransparentWindows]; |
419 | 420 |
420 _webView._drawsBackground = !useTransparentWindows; | 421 _webView._drawsBackground = !useTransparentWindows; |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 decisionHandler(WKNavigationActionPolicyAllow); | 633 decisionHandler(WKNavigationActionPolicyAllow); |
633 return; | 634 return; |
634 } | 635 } |
635 | 636 |
636 if (navigationAction._userInitiatedAction && !navigationAction._userInitiate
dAction.isConsumed) { | 637 if (navigationAction._userInitiatedAction && !navigationAction._userInitiate
dAction.isConsumed) { |
637 [navigationAction._userInitiatedAction consume]; | 638 [navigationAction._userInitiatedAction consume]; |
638 [[NSWorkspace sharedWorkspace] openURL:navigationAction.request.URL]; | 639 [[NSWorkspace sharedWorkspace] openURL:navigationAction.request.URL]; |
639 } | 640 } |
640 | 641 |
641 decisionHandler(WKNavigationActionPolicyCancel); | 642 decisionHandler(WKNavigationActionPolicyCancel); |
642 } | |
643 | |
644 - (void)webView:(WKWebView *)webView decidePolicyForSafeBrowsingResultForNavigat
ionAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKSaf
eBrowsingResultPolicy))decisionHandler | |
645 { | |
646 decisionHandler(WKSafeBrowsingResultPolicyCancelAndShowWarning); | |
647 } | 643 } |
648 | 644 |
649 - (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNaviga
tionResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponse
Policy))decisionHandler | 645 - (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNaviga
tionResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponse
Policy))decisionHandler |
650 { | 646 { |
651 LOG(@"decidePolicyForNavigationResponse"); | 647 LOG(@"decidePolicyForNavigationResponse"); |
652 decisionHandler(WKNavigationResponsePolicyAllow); | 648 decisionHandler(WKNavigationResponsePolicyAllow); |
653 } | 649 } |
654 | 650 |
655 - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation
*)navigation | 651 - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation
*)navigation |
656 { | 652 { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 return _webView; | 788 return _webView; |
793 } | 789 } |
794 | 790 |
795 - (void)findBarViewDidChangeHeight | 791 - (void)findBarViewDidChangeHeight |
796 { | 792 { |
797 } | 793 } |
798 | 794 |
799 @end | 795 @end |
800 | 796 |
801 #endif // WK_API_ENABLED | 797 #endif // WK_API_ENABLED |
LEFT | RIGHT |