+2014-03-14 Ryosuke Niwa <rniwa@webkit.org>
+
+ Revert erroneous changes made to UIProcess/API/Cocoa in r165676.
+
+ * UIProcess/API/Cocoa/WKBackForwardList.h:
+ * UIProcess/API/Cocoa/WKBackForwardListItem.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.h.
+ * UIProcess/API/Cocoa/WKNavigation.h:
+ * UIProcess/API/Cocoa/WKNavigationAction.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h.
+ * UIProcess/API/Cocoa/WKNavigationDelegate.h:
+ (NS_ENUM):
+ * UIProcess/API/Cocoa/WKNavigationResponse.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h.
+ * UIProcess/API/Cocoa/WKNavigationTrigger.h: Removed.
+ * UIProcess/API/Cocoa/WKWebView.h:
+
2014-03-14 Mark Rowe <mrowe@apple.com>
Fix the production build.
#if WK_API_ENABLED
-@class WKNavigation;
+#import <WebKit2/WKBackForwardListItem.h>
/*! Posted when a back-forward list changes. The notification object is the WKBackForwardList
that changed. The <code>userInfo</code> dictionary may contain the
/*! A key in the <code>userInfo</code> dictionary of a
@link WKBackForwardListDidChangeNotification @/link, whose value is the
- @link WKNavigation @/link that was appended to the list.
+ @link WKBackForwardListItem @/link that was appended to the list.
*/
WK_EXTERN NSString * const WKBackForwardListAddedItemKey;
/*! A key in the <code>userInfo</code> dictionary of a
@link WKBackForwardListDidChangeNotification @/link, whose value is an NSArray of
- @link WKNavigation@/link instances that were removed from the list.
+ @link WKBackForwardListItem@/link instances that were removed from the list.
*/
WK_EXTERN NSString * const WKBackForwardListRemovedItemsKey;
WK_API_CLASS
@interface WKBackForwardList : NSObject
-@property (readonly) WKNavigation *currentItem;
-@property (readonly) WKNavigation *backItem;
-@property (readonly) WKNavigation *forwardItem;
+@property (readonly) WKBackForwardListItem *currentItem;
+@property (readonly) WKBackForwardListItem *backItem;
+@property (readonly) WKBackForwardListItem *forwardItem;
-- (WKNavigation *)itemAtIndex:(NSInteger)index;
+- (WKBackForwardListItem *)itemAtIndex:(NSInteger)index;
@property (readonly) NSUInteger backListCount;
@property (readonly) NSUInteger forwardListCount;
--- /dev/null
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit2/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+#import <Foundation/Foundation.h>
+
+WK_API_CLASS
+@interface WKBackForwardListItem : NSObject
+
+@property (readonly) NSURL *URL;
+@property (readonly) NSString *title;
+@property (readonly) NSURL *originalURL;
+
+@end
+
+#endif // WK_API_ENABLED
#if WK_API_ENABLED
-@class WKFrameInfo;
-@class WKNavigationTrigger;
-
WK_API_CLASS
@interface WKNavigation : NSObject
-// What triggered this action?
-@property (nonatomic, readonly) WKNavigationTrigger *trigger;
-
-// Where is it going?
-@property (nonatomic, readonly) NSURLRequest *originalRequest;
@property (nonatomic, readonly) NSURLRequest *request;
-@property (nonatomic, readonly) WKFrameInfo *targetFrame;
-
-// What do we know so far? XXX: should this be factored into a separate result object?
-@property (nonatomic, readonly) NSURLResponse *response;
-@property (nonatomic, readonly) BOOL canShowMIMEType;
-@property (readonly) NSString *title;
@end
};
WK_API_CLASS
-@interface WKNavigationTrigger : NSObject
+@interface WKNavigationAction : NSObject
+
+@property (nonatomic, readonly) WKFrameInfo *sourceFrame;
+@property (nonatomic, readonly) WKFrameInfo *destinationFrame;
-@property (nonatomic, readonly) WKFrameInfo *originatingFrame;
@property (nonatomic, readonly) WKNavigationType navigationType;
-@property (nonatomic, readonly) NSUInteger modifierFlags;
-@property (nonatomic, readonly) NSUInteger mouseButton;
+@property (nonatomic, readonly) NSURLRequest *request;
@end
#if WK_API_ENABLED
@class WKNavigation;
+@class WKNavigationAction;
+@class WKNavigationResponse;
@class WKWebView;
typedef NS_ENUM(NSInteger, WKNavigationPolicyDecision) {
WKNavigationPolicyDecisionDownload
};
+typedef NS_ENUM(NSInteger, WKNavigationResponsePolicyDecision) {
+ WKNavigationResponsePolicyDecisionCancel,
+ WKNavigationResponsePolicyDecisionAllow,
+ WKNavigationResponsePolicyDecisionBecomeDownload
+};
+
@protocol WKNavigationDelegate <NSObject>
@optional
-- (void)webView:(WKWebView *)webView decideActionPolicyForNavigation:(WKNavigation *)navigation decisionHandler:(void (^)(WKNavigationPolicyDecision))decisionHandler;
-- (void)webView:(WKWebView *)webView decideResponsePolicyForNavigation:(WKNavigation *)navigationResponse decisionHandler:(void (^)(WKNavigationPolicyDecision))decisionHandler;
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationPolicyDecision))decisionHandler;
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicyDecision))decisionHandler;
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation;
- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation;
--- /dev/null
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+#import <WebKit2/WKFoundation.h>
+
+#if WK_API_ENABLED
+
+@class WKFrameInfo;
+
+WK_API_CLASS
+@interface WKNavigationResponse : NSObject
+
+@property (nonatomic, readonly) WKFrameInfo *frame;
+@property (nonatomic, readonly) NSURLResponse *response;
+@property (nonatomic, readonly) BOOL canShowMIMEType;
+
+@end
+
+#endif
#endif
@class WKBackForwardList;
+@class WKBackForwardListItem;
@class WKNavigation;
@class WKWebViewConfiguration;
@property (nonatomic, readonly) WKWebViewConfiguration *configuration;
@property (nonatomic, weak) id <WKNavigationDelegate> navigationDelegate;
-@property (nonatomic, weak) id <WKNavigationDelegate> subframeNavigationDelegate;
@property (nonatomic, weak) id <WKUIDelegate> UIDelegate;
/*! @abstract Navigates to an item from the back-forward list and sets it as the current item.
@param item The item to navigate to. Must be one of the items in the receiver's back-forward
list.
- @result A new navigation to requested item, or nil if it is the current item.
+ @result A new navigation to requested item, or nil if it is the current item.
@seealso backForwardList
*/
-- (WKNavigation *)goToBackForwardListItem:(WKNavigation *)item;
+- (WKNavigation *)goToBackForwardListItem:(WKBackForwardListItem *)item;
- (IBAction)stopLoading:(id)sender;