Switching tabs should not close PiP window
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jul 2018 17:03:39 +0000 (17:03 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jul 2018 17:03:39 +0000 (17:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188054
<rdar://problem/41212379>

Reviewed by Jon Lee.

No new tests, fixes an existing test.

Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
selectors to close the PiP window. requestHideAndExitFullscreen is also called from
WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
a new method that is only used by the delegate to exit PiP.

* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
do-nothing method.
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.h
Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm

index 130967f..7072433 100644 (file)
@@ -1,3 +1,29 @@
+2018-07-26  Eric Carlson  <eric.carlson@apple.com>
+
+        Switching tabs should not close PiP window
+        https://bugs.webkit.org/show_bug.cgi?id=188054
+        <rdar://problem/41212379>
+
+        Reviewed by Jon Lee.
+
+        No new tests, fixes an existing test.
+        
+        Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
+        In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
+        selectors to close the PiP window. requestHideAndExitFullscreen is also called from 
+        WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
+        tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
+        a new method that is only used by the delegate to exit PiP.
+
+        * platform/mac/VideoFullscreenInterfaceMac.h:
+        (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
+        do-nothing method.
+        * platform/mac/VideoFullscreenInterfaceMac.mm:
+        (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
+        (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
+        (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
+        (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
+
 2018-07-04  Darin Adler  <darin@apple.com>
 
         Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
index 8b68c6b..af2c649 100644 (file)
@@ -77,7 +77,7 @@ public:
     WEBCORE_EXPORT void exitFullscreenWithoutAnimationToMode(HTMLMediaElementEnums::VideoFullscreenMode);
     WEBCORE_EXPORT void cleanupFullscreen();
     WEBCORE_EXPORT void invalidate();
-    WEBCORE_EXPORT void requestHideAndExitFullscreen();
+    void requestHideAndExitFullscreen() { }
     WEBCORE_EXPORT void preparedToReturnToInline(bool visible, const IntRect& inlineRect, NSWindow *parentWindow);
     void preparedToExitFullscreen() { }
 
@@ -94,6 +94,8 @@ public:
 
     WEBCORE_EXPORT WebVideoFullscreenInterfaceMacObjC *videoFullscreenInterfaceObjC();
 
+    WEBCORE_EXPORT void requestHideAndExitPiP();
+
 private:
     WEBCORE_EXPORT VideoFullscreenInterfaceMac(PlaybackSessionInterfaceMac&);
     Ref<PlaybackSessionInterfaceMac> m_playbackSessionInterface;
index 8d24133..8a0d020 100644 (file)
@@ -274,7 +274,7 @@ enum class PIPState {
     if (!_videoFullscreenInterfaceMac || !_videoFullscreenInterfaceMac->videoFullscreenChangeObserver())
         return YES;
 
-    _videoFullscreenInterfaceMac->requestHideAndExitFullscreen();
+    _videoFullscreenInterfaceMac->requestHideAndExitPiP();
 
     return NO;
 }
@@ -335,7 +335,7 @@ enum class PIPState {
     if (PlaybackSessionModel* playbackSessionModel = _videoFullscreenInterfaceMac->playbackSessionModel())
         playbackSessionModel->pause();
 
-    _videoFullscreenInterfaceMac->requestHideAndExitFullscreen();
+    _videoFullscreenInterfaceMac->requestHideAndExitPiP();
     _pipState = PIPState::ExitingPIP;
 }
 
@@ -508,7 +508,7 @@ void VideoFullscreenInterfaceMac::invalidate()
     m_webVideoFullscreenInterfaceObjC = nil;
 }
 
-void VideoFullscreenInterfaceMac::requestHideAndExitFullscreen()
+void VideoFullscreenInterfaceMac::requestHideAndExitPiP()
 {
     if (!m_videoFullscreenModel)
         return;