Tweak _showSafeBrowsingWarningWithTitle SPI
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 06:03:19 +0000 (06:03 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 06:03:19 +0000 (06:03 +0000)
commitb0815f38f1d8c40764f221f3d4cd6080d9acb303
tree7e28ffb04787fd5628183bd1cb384c9f28e26925
parent103fb610ba49c122d8e340d9acd30a011b518749
Tweak _showSafeBrowsingWarningWithTitle SPI
https://bugs.webkit.org/show_bug.cgi?id=191799

Reviewed by Wenson Hsieh.

Source/WebCore:

It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.

Covered by updated API tests.

* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlCancelButtonTitle):
Make "Cancel"'s description a little more generic.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showSafeBrowsingWarningWithTitle:warning:details:completionHandler:]):
(+[WKWebView _visitUnsafeWebsiteSentinel]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Cocoa/WKSafeBrowsingWarning.mm:
(-[WKSafeBrowsingWarning clickedOnLink:]):
I need to localize "Continue" and "Cancel" so they aren't always in English.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/en.lproj/Localizable.strings
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit/UIProcess/Cocoa/WKSafeBrowsingWarning.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm