[Cocoa] Add -[WKBrowsingContextController goToBackForwardItem:]
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Oct 2013 20:39:33 +0000 (20:39 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Oct 2013 20:39:33 +0000 (20:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123289

Reviewed by Sam Weinig.

* Shared/API/Cocoa/WKFoundation.h: Defined WK_API_CLASS.
* UIProcess/API/mac/WKBrowsingContextController.h: Declared -goToBackForwardListItem:.
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController goToBackForwardListItem:]): Added.
* UIProcess/Cocoa/WKBackForwardList.h: Deployed WK_API_CLASS to make the class exported.
* UIProcess/Cocoa/WKBackForwardListItem.h: Ditto.
* UIProcess/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem _item]): Added. Returns the underlying WebBackForwardListItem.
* UIProcess/Cocoa/WKBackForwardListItemInternal.h: Declared _item.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157951 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/Cocoa/WKFoundation.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm
Source/WebKit2/UIProcess/Cocoa/WKBackForwardList.h
Source/WebKit2/UIProcess/Cocoa/WKBackForwardListItem.h
Source/WebKit2/UIProcess/Cocoa/WKBackForwardListItem.mm
Source/WebKit2/UIProcess/Cocoa/WKBackForwardListItemInternal.h

index e236f47..d0a27f7 100644 (file)
@@ -1,3 +1,20 @@
+2013-10-24  Dan Bernstein  <mitz@apple.com>
+
+        [Cocoa] Add -[WKBrowsingContextController goToBackForwardItem:]
+        https://bugs.webkit.org/show_bug.cgi?id=123289
+
+        Reviewed by Sam Weinig.
+
+        * Shared/API/Cocoa/WKFoundation.h: Defined WK_API_CLASS.
+        * UIProcess/API/mac/WKBrowsingContextController.h: Declared -goToBackForwardListItem:.
+        * UIProcess/API/mac/WKBrowsingContextController.mm:
+        (-[WKBrowsingContextController goToBackForwardListItem:]): Added.
+        * UIProcess/Cocoa/WKBackForwardList.h: Deployed WK_API_CLASS to make the class exported.
+        * UIProcess/Cocoa/WKBackForwardListItem.h: Ditto.
+        * UIProcess/Cocoa/WKBackForwardListItem.mm:
+        (-[WKBackForwardListItem _item]): Added. Returns the underlying WebBackForwardListItem.
+        * UIProcess/Cocoa/WKBackForwardListItemInternal.h: Declared _item.
+
 2013-10-23  ChangSeok Oh  <changseok.oh@collabora.com>
 
         Unreviewed build fix since r157823.
index 17cf1b0..b28eebb 100644 (file)
 
 #import <TargetConditionals.h>
 
+#if !defined(WK_API_ENABLED)
 #if TARGET_OS_IPHONE
 #define WK_API_ENABLED 1
+#define WK_API_CLASS NS_CLASS_AVAILABLE_IOS(7_0)
 #else
 #define WK_API_ENABLED (defined(__clang__) && defined(__APPLE__) && !defined(__i386__))
+#define WK_API_CLASS NS_CLASS_AVAILABLE_MAC(10_9)
+#endif
 #endif
index f081cd7..9061b9e 100644 (file)
@@ -29,6 +29,7 @@
 
 @class WKBrowsingContextControllerData;
 @class WKBackForwardList;
+@class WKBackForwardListItem;
 @protocol WKBrowsingContextLoadDelegate;
 
 WK_EXPORT
@@ -93,8 +94,10 @@ WK_EXPORT
 @property(readonly) BOOL canGoBack;
 
 #if WK_API_ENABLED
+- (void)goToBackForwardListItem:(WKBackForwardListItem *)item;
+
 @property(readonly) WKBackForwardList *backForwardList;
-#endif
+#endif // WK_API_ENABLED
 
 #pragma mark Active Load Introspection
 
index 3c156db..c38cef2 100644 (file)
@@ -256,6 +256,11 @@ static void releaseNSData(unsigned char*, const void* data)
 }
 
 #if WK_API_ENABLED
+- (void)goToBackForwardListItem:(WKBackForwardListItem *)item
+{
+    toImpl(self._pageRef)->goToBackForwardItem(&item._item);
+}
+
 - (WKBackForwardList *)backForwardList
 {
     WebBackForwardList* list = toImpl(self._pageRef)->backForwardList();
index 0289185..2f96718 100644 (file)
@@ -32,6 +32,7 @@
 
 #if WK_API_ENABLED
 
+WK_API_CLASS
 @interface WKBackForwardList : NSObject
 
 @property (readonly) WKBackForwardListItem *currentItem;
index c3c203f..ecc8246 100644 (file)
@@ -31,6 +31,7 @@
 
 #if WK_API_ENABLED
 
+WK_API_CLASS
 @interface WKBackForwardListItem : NSObject
 
 @property (readonly) NSURL *URL;
index fd017f5..45ef377 100644 (file)
@@ -95,6 +95,11 @@ using namespace WebKit;
     return self;
 }
 
+- (WebKit::WebBackForwardListItem&)_item
+{
+    return *_item;
+}
+
 @end
 
 #endif // WK_API_ENABLED
index 3d12adb..1b83342 100644 (file)
@@ -35,6 +35,8 @@ class WebBackForwardListItem;
 
 - (id)_initWithItem:(WebKit::WebBackForwardListItem&)item;
 
+@property (readonly) WebKit::WebBackForwardListItem& _item;
+
 @end
 
 #endif // WK_API_ENABLED