WebKit Bugzilla
Attachment 360054 Details for
Bug 193802
: Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193802-20190124165544.patch (text/plain), 7.44 KB, created by
Alex Christensen
on 2019-01-24 16:55:44 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-01-24 16:55:44 PST
Size:
7.44 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 240445) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,21 @@ >+2019-01-24 Alex Christensen <achristensen@webkit.org> >+ >+ Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning >+ https://bugs.webkit.org/show_bug.cgi?id=193802 >+ <rdar://problem/46010580> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/API/APIUIClient.h: >+ (API::UIClient::didClickGoBackFromSafeBrowsingWarning): >+ * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: >+ * UIProcess/Cocoa/UIDelegate.h: >+ * UIProcess/Cocoa/UIDelegate.mm: >+ (WebKit::UIDelegate::setDelegate): >+ (WebKit::UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning): >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::decidePolicyForNavigationAction): >+ > 2019-01-24 John Wilander <wilander@apple.com> > > Add Ad Click Attribution as an internal/experimental feature >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 240445) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -4433,6 +4433,7 @@ void WebPageProxy::decidePolicyForNaviga > }, [&] (ContinueUnsafeLoad continueUnsafeLoad) { > switch (continueUnsafeLoad) { > case ContinueUnsafeLoad::No: >+ protectedThis->m_uiClient->didClickGoBackFromSafeBrowsingWarning(); > completionHandler(WebPolicyAction::Ignore); > break; > case ContinueUnsafeLoad::Yes: >Index: Source/WebKit/UIProcess/API/APIUIClient.h >=================================================================== >--- Source/WebKit/UIProcess/API/APIUIClient.h (revision 240445) >+++ Source/WebKit/UIProcess/API/APIUIClient.h (working copy) >@@ -182,6 +182,7 @@ public: > virtual void didExceedBackgroundResourceLimitWhileInForeground(WebKit::WebPageProxy&, WKResourceLimit) { } > > virtual void didShowSafeBrowsingWarning() { } >+ virtual void didClickGoBackFromSafeBrowsingWarning() { } > }; > > } // namespace API >Index: Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (revision 240445) >+++ Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (working copy) >@@ -102,6 +102,7 @@ struct UIEdgeInsets; > - (void)_webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12.3)); > - (void)_webViewDidRequestPointerLock:(WKWebView *)webView completionHandler:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > - (void)_webViewDidShowSafeBrowsingWarning:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >+- (void)_webViewDidClickGoBackFromSafeBrowsingWarning:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > - (void)_webViewDidLosePointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12.3)); > - (void)_webView:(WKWebView *)webView hasVideoInPictureInPictureDidChange:(BOOL)hasVideoInPictureInPicture WK_API_AVAILABLE(macosx(10.13), ios(11.0)); > >Index: Source/WebKit/UIProcess/Cocoa/UIDelegate.h >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/UIDelegate.h (revision 240445) >+++ Source/WebKit/UIProcess/Cocoa/UIDelegate.h (working copy) >@@ -147,6 +147,7 @@ private: > > void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&) final; > void didShowSafeBrowsingWarning() final; >+ void didClickGoBackFromSafeBrowsingWarning() final; > > UIDelegate& m_uiDelegate; > }; >@@ -224,6 +225,7 @@ private: > #endif > bool webViewHasVideoInPictureInPictureDidChange : 1; > bool webViewDidShowSafeBrowsingWarning : 1; >+ bool webViewDidClickGoBackFromSafeBrowsingWarning : 1; > } m_delegateMethods; > }; > >Index: Source/WebKit/UIProcess/Cocoa/UIDelegate.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (revision 240445) >+++ Source/WebKit/UIProcess/Cocoa/UIDelegate.mm (working copy) >@@ -172,6 +172,7 @@ void UIDelegate::setDelegate(id <WKUIDel > > m_delegateMethods.webViewHasVideoInPictureInPictureDidChange = [delegate respondsToSelector:@selector(_webView:hasVideoInPictureInPictureDidChange:)]; > m_delegateMethods.webViewDidShowSafeBrowsingWarning = [delegate respondsToSelector:@selector(_webViewDidShowSafeBrowsingWarning:)]; >+ m_delegateMethods.webViewDidClickGoBackFromSafeBrowsingWarning = [delegate respondsToSelector:@selector(_webViewDidClickGoBackFromSafeBrowsingWarning:)]; > } > > #if ENABLE(CONTEXT_MENUS) >@@ -1257,6 +1258,18 @@ void UIDelegate::UIClient::didShowSafeBr > [static_cast<id <WKUIDelegatePrivate>>(delegate) _webViewDidShowSafeBrowsingWarning:m_uiDelegate.m_webView]; > } > >+void UIDelegate::UIClient::didClickGoBackFromSafeBrowsingWarning() >+{ >+ if (!m_uiDelegate.m_delegateMethods.webViewDidClickGoBackFromSafeBrowsingWarning) >+ return; >+ >+ auto delegate = m_uiDelegate.m_delegate.get(); >+ if (!delegate) >+ return; >+ >+ [static_cast<id <WKUIDelegatePrivate>>(delegate) _webViewDidClickGoBackFromSafeBrowsingWarning:m_uiDelegate.m_webView]; >+} >+ > void UIDelegate::UIClient::hasVideoInPictureInPictureDidChange(WebPageProxy*, bool hasVideoInPictureInPicture) > { > if (!m_uiDelegate.m_delegateMethods.webViewHasVideoInPictureInPictureDidChange) >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 240455) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2019-01-24 Alex Christensen <achristensen@webkit.org> >+ >+ Add SPI to inform an application that "Go Back" has been clicked from a safe browsing warning >+ https://bugs.webkit.org/show_bug.cgi?id=193802 >+ <rdar://problem/46010580> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm: >+ (-[SafeBrowsingNavigationDelegate _webViewDidClickGoBackFromSafeBrowsingWarning:]): >+ (TEST): >+ > 2019-01-24 Jonathan Bedard <jbedard@apple.com> > > [webkitdirs] iosSimulatorApplicationsPath may not have iOS.simruntime in its path >Index: Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (revision 240445) >+++ Tools/TestWebKitAPI/Tests/WebKitCocoa/SafeBrowsing.mm (working copy) >@@ -40,6 +40,7 @@ > > static bool committedNavigation; > static bool warningShown; >+static bool goBackClicked; > > @interface SafeBrowsingNavigationDelegate : NSObject <WKNavigationDelegate, WKUIDelegatePrivate> > @end >@@ -56,6 +57,11 @@ - (void)_webViewDidShowSafeBrowsingWarni > warningShown = true; > } > >+- (void)_webViewDidClickGoBackFromSafeBrowsingWarning:(WKWebView *)webView >+{ >+ goBackClicked = true; >+} >+ > @end > > @interface TestServiceLookupResult : NSObject { >@@ -221,7 +227,9 @@ template<typename ViewType> void goBack( > TEST(SafeBrowsing, GoBack) > { > auto webView = safeBrowsingView(); >+ EXPECT_FALSE(goBackClicked); > goBack([webView _safeBrowsingWarning]); >+ EXPECT_TRUE(goBackClicked); > } > > template<typename ViewType> void visitUnsafeSite(ViewType *view)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
aestes
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193802
: 360054