Changeset 217252 in webkit


Ignore:
Timestamp:
May 22, 2017 3:41:02 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Need a way to allow WKWebView to load request with ShouldOpenExternalURLsPolicy::ShouldAllow.
https://bugs.webkit.org/show_bug.cgi?id=172460

Add an new method [WKWebView _loadRequest:shouldOpenExternalURLs:] to WKWebView; a WebKit client
can use this to load request that allows opening external URLs.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2017-05-22
Reviewed by Tim Horton.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _loadRequest:shouldOpenExternalURLs:]): When calling WebPageProxy::loadRequest, also

set ShouldOpenExternalURLsPolicy based on the value of shouldOpenExternalURLs.

  • UIProcess/API/Cocoa/WKWebViewPrivate.h: Add [WKWebView _loadRequest:shouldOpenExternalURLs:].
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r217251 r217252  
     12017-05-22  Yongjun Zhang  <yongjun_zhang@apple.com>
     2
     3        Need a way to allow WKWebView to load request with ShouldOpenExternalURLsPolicy::ShouldAllow.
     4        https://bugs.webkit.org/show_bug.cgi?id=172460
     5
     6        Add an new method [WKWebView _loadRequest:shouldOpenExternalURLs:] to WKWebView; a WebKit client
     7        can use this to load request that allows opening external URLs.
     8
     9        Reviewed by Tim Horton.
     10
     11        * UIProcess/API/Cocoa/WKWebView.mm:
     12        (-[WKWebView _loadRequest:shouldOpenExternalURLs:]): When calling WebPageProxy::loadRequest, also
     13            set ShouldOpenExternalURLsPolicy based on the value of shouldOpenExternalURLs.
     14        * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add [WKWebView _loadRequest:shouldOpenExternalURLs:].
     15
    1162017-05-22  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r217041 r217252  
    37033703}
    37043704
     3705- (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLs:(BOOL)shouldOpenExternalURLs
     3706{
     3707    auto navigation = _page->loadRequest(request, shouldOpenExternalURLs ? WebCore::ShouldOpenExternalURLsPolicy::ShouldAllow : WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow);
     3708    if (!navigation)
     3709        return nil;
     3710
     3711    return [wrapper(*navigation.leakRef()) autorelease];
     3712}
     3713
    37053714- (NSArray *)_certificateChain
    37063715{
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h

    r216935 r217252  
    104104- (void)_loadAlternateHTMLString:(NSString *)string baseURL:(NSURL *)baseURL forUnreachableURL:(NSURL *)unreachableURL;
    105105- (WKNavigation *)_loadData:(NSData *)data MIMEType:(NSString *)MIMEType characterEncodingName:(NSString *)characterEncodingName baseURL:(NSURL *)baseURL userData:(id)userData WK_API_AVAILABLE(macosx(10.12), ios(10.0));
     106- (WKNavigation *)_loadRequest:(NSURLRequest *)request shouldOpenExternalURLs:(BOOL)shouldOpenExternalURLs WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
    106107
    107108@property (nonatomic, readonly) NSArray *_certificateChain WK_API_DEPRECATED_WITH_REPLACEMENT("certificateChain", macosx(10.10, 10.11), ios(8.0, 9.0));
Note: See TracChangeset for help on using the changeset viewer.