Expose full screen controller SPI to check if full screen is open and close full...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 17:34:46 +0000 (17:34 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 17:34:46 +0000 (17:34 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197263

Patch by Jay Mulani <jmulani@apple.com> on 2019-05-03
Reviewed by Jer Noble.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView closeFullScreenWindowController]):
(-[WKWebView fullScreenWindowController]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h

index e2b557d..31bd96c 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-03  Jay Mulani  <jmulani@apple.com>
+
+        Expose full screen controller SPI to check if full screen is open and close full screen
+        https://bugs.webkit.org/show_bug.cgi?id=197263
+
+        Reviewed by Jer Noble.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView closeFullScreenWindowController]):
+        (-[WKWebView fullScreenWindowController]):
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
 2019-05-03  Youenn Fablet  <youenn@apple.com>
 
         LayoutTest imported/w3c/web-platform-tests/xhr/event-upload-progress-crossorigin.htm is a flaky failure
index fff5557..0cc03c3 100644 (file)
@@ -7311,28 +7311,32 @@ static WebCore::UserInterfaceLayoutDirection toUserInterfaceLayoutDirection(UISe
 
 #if ENABLE(FULLSCREEN_API) && PLATFORM(IOS_FAMILY)
 
-@implementation WKWebView (FullScreenAPI)
+@implementation WKWebView (FullScreenAPI_Private)
 
 - (BOOL)hasFullScreenWindowController
 {
     return !!_fullScreenWindowController;
 }
 
-- (WKFullScreenWindowController *)fullScreenWindowController
+- (void)closeFullScreenWindowController
 {
     if (!_fullScreenWindowController)
-        _fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWebView:self]);
+        return;
 
-    return _fullScreenWindowController.get();
+    [_fullScreenWindowController close];
+    _fullScreenWindowController = nullptr;
 }
 
-- (void)closeFullScreenWindowController
+@end
+
+@implementation WKWebView (FullScreenAPI_Internal)
+
+- (WKFullScreenWindowController *)fullScreenWindowController
 {
     if (!_fullScreenWindowController)
-        return;
+        _fullScreenWindowController = adoptNS([[WKFullScreenWindowController alloc] initWithWebView:self]);
 
-    [_fullScreenWindowController close];
-    _fullScreenWindowController = nullptr;
+    return _fullScreenWindowController.get();
 }
 
 @end
index 36c6818..56fe5c2 100644 (file)
@@ -195,12 +195,10 @@ struct PrintInfo;
 WKWebView* fromWebPageProxy(WebKit::WebPageProxy&);
 
 #if ENABLE(FULLSCREEN_API) && PLATFORM(IOS_FAMILY)
-@interface WKWebView (FullScreenAPI)
--(BOOL)hasFullScreenWindowController;
+@interface WKWebView (FullScreenAPI_Internal)
 -(WKFullScreenWindowController *)fullScreenWindowController;
--(void)closeFullScreenWindowController;
 @end
-#endif // ENABLE(FULLSCREEN_API) && PLATFORM(IOS_FAMILY)
+#endif
 
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC)
 @interface WKWebView (_WKWebViewPrintFormatter)
index fa372e9..06c1eb4 100644 (file)
@@ -427,6 +427,13 @@ typedef NS_OPTIONS(NSUInteger, _WKRectEdge) {
 
 @end
 
+#if TARGET_OS_IOS || (defined(TARGET_OS_IOSMAC) && TARGET_OS_IOSMAC) || TARGET_OS_TV
+@interface WKWebView (FullScreenAPI_Private)
+-(BOOL)hasFullScreenWindowController;
+-(void)closeFullScreenWindowController;
+@end
+#endif
+
 #if TARGET_OS_IPHONE
 
 @interface WKWebView () <UIResponderStandardEditActions>