Changeset 164138 in webkit


Ignore:
Timestamp:
Feb 14, 2014 3:15:18 PM (10 years ago)
Author:
andersca@apple.com
Message:

Add SPI for authentication
https://bugs.webkit.org/show_bug.cgi?id=128847

Reviewed by Dan Bernstein.

  • UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
  • UIProcess/Cocoa/NavigationState.h:
  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
(WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r164132 r164138  
     12014-02-14  Anders Carlsson  <andersca@apple.com>
     2
     3        Add SPI for authentication
     4        https://bugs.webkit.org/show_bug.cgi?id=128847
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
     9        * UIProcess/Cocoa/NavigationState.h:
     10        * UIProcess/Cocoa/NavigationState.mm:
     11        (WebKit::NavigationState::setNavigationDelegate):
     12        (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
     13        (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):
     14
    1152014-02-14  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.mm

    r164132 r164138  
    3232#import "WKNSArray.h"
    3333
    34 WK_EXPORT NSString * const WKBackForwardListDidChangeNotification = @"WKBackForwardListDidChangeNotification";
    35 WK_EXPORT NSString * const WKBackForwardListAddedItemKey = @"WKBackForwardListAddedItemKey";
    36 WK_EXPORT NSString * const WKBackForwardListRemovedItemsKey = @"WKBackForwardListRemovedItemsKey";
     34NSString * const WKBackForwardListDidChangeNotification = @"WKBackForwardListDidChangeNotification";
     35NSString * const WKBackForwardListAddedItemKey = @"WKBackForwardListAddedItemKey";
     36NSString * const WKBackForwardListRemovedItemsKey = @"WKBackForwardListRemovedItemsKey";
    3737
    3838using namespace WebKit;
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h

    r164049 r164138  
    3535- (void)_webView:(WKWebView *)webView renderingProgressDidChange:(_WKRenderingProgressEvents)progressEvents;
    3636
     37- (BOOL)_webView:(WKWebView *)webView canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace;
     38- (void)_webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
     39
    3740@end
    3841
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h

    r164132 r164138  
    8585        virtual void didFailLoadWithErrorForFrame(WebPageProxy*, WebFrameProxy*, uint64_t navigationID, const WebCore::ResourceError&, API::Object*) override;
    8686        virtual void didLayout(WebKit::WebPageProxy*, WebCore::LayoutMilestones, API::Object*) override;
     87        virtual bool canAuthenticateAgainstProtectionSpaceInFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::WebProtectionSpace*) override;
     88        virtual void didReceiveAuthenticationChallengeInFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::AuthenticationChallengeProxy*) override;
    8789        virtual void didChangeBackForwardList(WebKit::WebPageProxy*, WebKit::WebBackForwardListItem* addedItem, Vector<RefPtr<WebKit::WebBackForwardListItem>> removedItems) override;
    8890
     
    117119
    118120        bool webViewRenderingProgressDidChange : 1;
     121        bool webViewCanAuthenticateAgainstProtectionSpace : 1;
     122        bool webViewDidReceiveAuthenticationChallenge : 1;
    119123    } m_navigationDelegateMethods;
    120124
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm

    r164132 r164138  
    3434#import "WKBackForwardListItemInternal.h"
    3535#import "WKFrameInfoInternal.h"
     36#import "WKNSURLAuthenticationChallenge.h"
     37#import "WKNSURLProtectionSpace.h"
    3638#import "WKNavigationActionInternal.h"
    3739#import "WKNavigationDelegatePrivate.h"
     
    8890
    8991    m_navigationDelegateMethods.webViewRenderingProgressDidChange = [delegate respondsToSelector:@selector(_webView:renderingProgressDidChange:)];
     92    m_navigationDelegateMethods.webViewCanAuthenticateAgainstProtectionSpace = [delegate respondsToSelector:@selector(_webView:canAuthenticateAgainstProtectionSpace:)];
     93    m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallenge = [delegate respondsToSelector:@selector(_webView:didReceiveAuthenticationChallenge:)];
    9094}
    9195
     
    375379}
    376380
     381bool NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::WebProtectionSpace* protectionSpace)
     382{
     383    if (!m_navigationState.m_navigationDelegateMethods.webViewCanAuthenticateAgainstProtectionSpace)
     384        return false;
     385
     386    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
     387    if (!navigationDelegate)
     388        return false;
     389
     390    return [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView canAuthenticateAgainstProtectionSpace:wrapper(*protectionSpace)];
     391}
     392
     393void NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame(WebKit::WebPageProxy*, WebKit::WebFrameProxy*, WebKit::AuthenticationChallengeProxy* authenticationChallenge)
     394{
     395    if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallenge)
     396        return;
     397
     398    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
     399    if (!navigationDelegate)
     400        return;
     401
     402    [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView didReceiveAuthenticationChallenge:wrapper(*authenticationChallenge)];
     403}
     404
    377405void NavigationState::LoaderClient::didChangeBackForwardList(WebKit::WebPageProxy*, WebKit::WebBackForwardListItem* addedItem, Vector<RefPtr<WebKit::WebBackForwardListItem>> removedItems)
    378406{
Note: See TracChangeset for help on using the changeset viewer.