Changeset 185653 in webkit
- Timestamp:
- Jun 17, 2015 9:18:04 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r185651 r185653 1 2015-06-17 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Expose UIDelegate::UIClient::close via WKUIDelegate 4 https://bugs.webkit.org/show_bug.cgi?id=145957 5 6 Reviewed by Darin Adler. 7 8 * UIProcess/API/Cocoa/WKUIDelegate.h: Added -webViewDidClose: to the protocol. 9 * UIProcess/Cocoa/UIDelegate.h: Added a webViewDidClose boolean to the delegate methods struct. 10 * UIProcess/Cocoa/UIDelegate.mm: 11 (WebKit::UIDelegate::setDelegate): Initialize the webViewDidClose boolean. 12 (WebKit::UIDelegate::UIClient::close): Changed to call the new delegate method. Left behind 13 code that calls the old private method if it’s implemented. 14 1 15 2015-06-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 16 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegate.h
r183070 r185653 58 58 - (WK_NULLABLE WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures; 59 59 60 /*! @abstract Notifies your app that the DOM window object's close() method completed successfully. 61 @param webView The web view invoking the delegate method. 62 @discussion Your app should remove the web view from the view hierarchy and update 63 the UI as needed, such as by closing the containing browser tab or window. 64 */ 65 - (void)webViewDidClose:(WKWebView *)webView; 66 60 67 /*! @abstract Displays a JavaScript alert panel. 61 68 @param webView The web view invoking the delegate method. -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
r177639 r185653 89 89 bool webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded : 1; 90 90 bool webViewPrintFrame : 1; 91 bool webViewDidClose : 1; 91 92 bool webViewClose : 1; 92 93 bool webViewFullscreenMayReturnToInline : 1; -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
r179328 r185653 72 72 m_delegateMethods.webViewDecideWebApplicationCacheQuotaForSecurityOriginCurrentQuotaTotalBytesNeeded = [delegate respondsToSelector:@selector(_webView:decideWebApplicationCacheQuotaForSecurityOrigin:currentQuota:totalBytesNeeded:decisionHandler:)]; 73 73 m_delegateMethods.webViewPrintFrame = [delegate respondsToSelector:@selector(_webView:printFrame:)]; 74 m_delegateMethods.webViewDidClose = [delegate respondsToSelector:@selector(webViewDidClose:)]; 74 75 m_delegateMethods.webViewClose = [delegate respondsToSelector:@selector(_webViewClose:)]; 75 76 m_delegateMethods.webViewFullscreenMayReturnToInline = [delegate respondsToSelector:@selector(_webViewFullscreenMayReturnToInline:)]; … … 233 234 void UIDelegate::UIClient::close(WebKit::WebPageProxy*) 234 235 { 235 if (!m_uiDelegate.m_delegateMethods.webViewClose) 236 return; 237 238 auto delegate = m_uiDelegate.m_delegate.get(); 239 if (!delegate) 240 return; 241 242 [(id <WKUIDelegatePrivate>)delegate _webViewClose:m_uiDelegate.m_webView]; 236 if (m_uiDelegate.m_delegateMethods.webViewClose) { 237 auto delegate = m_uiDelegate.m_delegate.get(); 238 if (!delegate) 239 return; 240 241 [(id <WKUIDelegatePrivate>)delegate _webViewClose:m_uiDelegate.m_webView]; 242 return; 243 } 244 245 if (!m_uiDelegate.m_delegateMethods.webViewDidClose) 246 return; 247 248 auto delegate = m_uiDelegate.m_delegate.get(); 249 if (!delegate) 250 return; 251 252 [delegate webViewDidClose:m_uiDelegate.m_webView]; 243 253 } 244 254 -
trunk/Tools/ChangeLog
r185609 r185653 1 2015-06-17 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Expose UIDelegate::UIClient::close via WKUIDelegate 4 https://bugs.webkit.org/show_bug.cgi?id=145957 5 6 Reviewed by Darin Adler. 7 8 * TestWebKitAPI/Tests/WebKit2Cocoa/OpenAndCloseWindow.mm: 9 (-[OpenAndCloseWindowUIDelegate webViewDidClose:]): Renamed from -_webViewClose:. 10 1 11 2015-06-15 Chris Fleizach <cfleizach@apple.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/OpenAndCloseWindow.mm
r173851 r185653 46 46 @implementation OpenAndCloseWindowUIDelegate 47 47 48 - (void) _webViewClose:(WKWebView *)webView48 - (void)webViewDidClose:(WKWebView *)webView 49 49 { 50 50 EXPECT_EQ(openedWebView, webView);
Note: See TracChangeset
for help on using the changeset viewer.