Title: [98259] trunk/Source/WebKit2
- Revision
- 98259
- Author
- [email protected]
- Date
- 2011-10-24 11:36:18 -0700 (Mon, 24 Oct 2011)
Log Message
Add zoom and title support to Objective-C WebKit2 API
https://bugs.webkit.org/show_bug.cgi?id=70744
Reviewed by Darin Adler.
* UIProcess/API/mac/WKBrowsingContextController.h:
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController title]):
(-[WKBrowsingContextController textZoom]):
(-[WKBrowsingContextController setTextZoom:]):
(-[WKBrowsingContextController pageZoom]):
(-[WKBrowsingContextController setPageZoom:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (98258 => 98259)
--- trunk/Source/WebKit2/ChangeLog 2011-10-24 18:31:55 UTC (rev 98258)
+++ trunk/Source/WebKit2/ChangeLog 2011-10-24 18:36:18 UTC (rev 98259)
@@ -1,3 +1,18 @@
+2011-10-24 Sam Weinig <[email protected]>
+
+ Add zoom and title support to Objective-C WebKit2 API
+ https://bugs.webkit.org/show_bug.cgi?id=70744
+
+ Reviewed by Darin Adler.
+
+ * UIProcess/API/mac/WKBrowsingContextController.h:
+ * UIProcess/API/mac/WKBrowsingContextController.mm:
+ (-[WKBrowsingContextController title]):
+ (-[WKBrowsingContextController textZoom]):
+ (-[WKBrowsingContextController setTextZoom:]):
+ (-[WKBrowsingContextController pageZoom]):
+ (-[WKBrowsingContextController setPageZoom:]):
+
2011-10-24 Carlos Garcia Campos <[email protected]>
[GTK] Fix make distcheck build
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h (98258 => 98259)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h 2011-10-24 18:31:55 UTC (rev 98258)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.h 2011-10-24 18:36:18 UTC (rev 98259)
@@ -62,13 +62,28 @@
/* Go to the next page in the back/forward list. */
- (void)goForward;
-/* Returns whether there is a next page in the back/forward list. */
-- (BOOL)canGoForward;
+/* Whether there is a next page in the back/forward list. */
+@property(readonly) BOOL canGoForward;
/* Go to the previous page in the back/forward list. */
- (void)goBack;
-/* Returns whether there is a previous page in the back/forward list. */
-- (BOOL)canGoBack;
+/* Whether there is a previous page in the back/forward list. */
+@property(readonly) BOOL canGoBack;
+
+#pragma mark Active Document Introspection
+
+/* Title of the document associated with the active load. */
+@property(readonly) NSString *title;
+
+
+#pragma mark Zoom
+
+/* Sets the text zoom for the active URL. */
+@property CGFloat textZoom;
+
+/* Sets the text zoom for the active URL. */
+@property CGFloat pageZoom;
+
@end
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm (98258 => 98259)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm 2011-10-24 18:31:55 UTC (rev 98258)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm 2011-10-24 18:36:18 UTC (rev 98259)
@@ -31,6 +31,7 @@
#import "WKRetainPtr.h"
#import "WKURLRequest.h"
#import "WKURLRequestNS.h"
+#import "WKStringCF.h"
@interface WKBrowsingContextControllerData : NSObject {
@public
@@ -104,6 +105,36 @@
return WKPageCanGoBack(self.pageRef);
}
+#pragma mark Active Document Introspection
+
+- (NSString *)title
+{
+ WKRetainPtr<WKStringRef> wkTitle = adoptWK(WKPageCopyTitle(self.pageRef));
+ return [(NSString *)WKStringCopyCFString(kCFAllocatorDefault, wkTitle.get()) autorelease];
+}
+
+#pragma mark Zoom
+
+- (CGFloat)textZoom
+{
+ return WKPageGetTextZoomFactor(self.pageRef);
+}
+
+- (void)setTextZoom:(CGFloat)textZoom
+{
+ return WKPageSetTextZoomFactor(self.pageRef, textZoom);
+}
+
+- (CGFloat)pageZoom
+{
+ return WKPageGetPageZoomFactor(self.pageRef);
+}
+
+- (void)setPageZoom:(CGFloat)pageZoom
+{
+ return WKPageSetPageZoomFactor(self.pageRef, pageZoom);
+}
+
@end
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes