Title: [187252] trunk/Source/WebKit2
Revision
187252
Author
[email protected]
Date
2015-07-23 14:17:38 -0700 (Thu, 23 Jul 2015)

Log Message

[WK2] Add a WKWebView property for whether the view is displaying a media document
https://bugs.webkit.org/show_bug.cgi?id=147233

Reviewed by Beth Dakin.

Add a _isDisplayingStandaloneMediaDocument property, which queries the frame for whether
the current MIME type is one which our media engines support.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isDisplayingStandaloneMediaDocument]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::isDisplayingStandaloneMediaDocument):
* UIProcess/WebFrameProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187251 => 187252)


--- trunk/Source/WebKit2/ChangeLog	2015-07-23 21:15:28 UTC (rev 187251)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-23 21:17:38 UTC (rev 187252)
@@ -1,3 +1,20 @@
+2015-07-23  Jer Noble  <[email protected]>
+
+        [WK2] Add a WKWebView property for whether the view is displaying a media document
+        https://bugs.webkit.org/show_bug.cgi?id=147233
+
+        Reviewed by Beth Dakin.
+
+        Add a _isDisplayingStandaloneMediaDocument property, which queries the frame for whether
+        the current MIME type is one which our media engines support.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _isDisplayingStandaloneMediaDocument]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::isDisplayingStandaloneMediaDocument):
+        * UIProcess/WebFrameProxy.h:
+
 2015-07-21  Jer Noble  <[email protected]>
 
         [iOS] Add an explicit API to allow media documents to (temporarily) play inline

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (187251 => 187252)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-07-23 21:15:28 UTC (rev 187251)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-07-23 21:17:38 UTC (rev 187252)
@@ -2465,6 +2465,13 @@
     return NO;
 }
 
+- (BOOL)_isDisplayingStandaloneMediaDocument
+{
+    if (auto* mainFrame = _page->mainFrame())
+        return mainFrame->isDisplayingStandaloneMediaDocument();
+    return NO;
+}
+
 - (BOOL)_isShowingNavigationGestureSnapshot
 {
     return _page->isShowingNavigationGestureSnapshot();

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (187251 => 187252)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2015-07-23 21:15:28 UTC (rev 187251)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2015-07-23 21:17:38 UTC (rev 187252)
@@ -203,6 +203,7 @@
 @property (nonatomic, weak, setter=_setFormDelegate:) id <_WKFormDelegate> _formDelegate;
 
 @property (nonatomic, readonly, getter=_isDisplayingStandaloneImageDocument) BOOL _displayingStandaloneImageDocument;
+@property (nonatomic, readonly, getter=_isDisplayingStandaloneMediaDocument) BOOL _displayingStandaloneMediaDocument;
 
 @property (nonatomic, setter=_setScrollPerformanceDataCollectionEnabled:) BOOL _scrollPerformanceDataCollectionEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 @property (nonatomic, readonly) NSArray *_scrollPerformanceData WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);

Modified: trunk/Source/WebKit2/UIProcess/WebFrameProxy.cpp (187251 => 187252)


--- trunk/Source/WebKit2/UIProcess/WebFrameProxy.cpp	2015-07-23 21:15:28 UTC (rev 187251)
+++ trunk/Source/WebKit2/UIProcess/WebFrameProxy.cpp	2015-07-23 21:17:38 UTC (rev 187252)
@@ -110,6 +110,11 @@
     return Image::supportsType(m_MIMEType);
 }
 
+bool WebFrameProxy::isDisplayingStandaloneMediaDocument() const
+{
+    return MIMETypeRegistry::isSupportedMediaMIMEType(m_MIMEType);
+}
+
 bool WebFrameProxy::isDisplayingMarkupDocument() const
 {
     // FIXME: This check should be moved to somewhere in WebCore.

Modified: trunk/Source/WebKit2/UIProcess/WebFrameProxy.h (187251 => 187252)


--- trunk/Source/WebKit2/UIProcess/WebFrameProxy.h	2015-07-23 21:15:28 UTC (rev 187251)
+++ trunk/Source/WebKit2/UIProcess/WebFrameProxy.h	2015-07-23 21:17:38 UTC (rev 187252)
@@ -97,6 +97,7 @@
     bool canShowMIMEType(const String& mimeType) const;
 
     bool isDisplayingStandaloneImageDocument() const;
+    bool isDisplayingStandaloneMediaDocument() const;
     bool isDisplayingMarkupDocument() const;
     bool isDisplayingPDFDocument() const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to