Commit 48762dae authored by jer.noble@apple.com's avatar jer.noble@apple.com

2011-03-11 Jer Noble <jer.noble@apple.com>

        Reviewed by Anders Carlsson.

        Add full screen animation code to WebFullScreenManager.
        https://bugs.webkit.org/show_bug.cgi?id=56220

        * WebProcess/FullScreen/WebFullScreenManager.cpp: .
        (WebKit::WebFullScreenManager::~WebFullScreenManager): Added.
        (WebKit::WebFullScreenManager::exitFullScreenForElement): Remove ASSERTs.
        (WebKit::WebFullScreenManager::willEnterFullScreen): Set the full screen renderer's background color.
        (WebKit::WebFullScreenManager::didEnterFullScreen): Ditto.
        (WebKit::WebFullScreenManager::willExitFullScreen): Ditto.
        (WebKit::WebFullScreenManager::didExitFullScreen): Ditto.
        * WebProcess/FullScreen/WebFullScreenManager.h: Make a few functions pure virtual to be implemented in a
            concrete subclass.
        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.h: Added.
        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm: Added.
        (-[WebFullScreenManagerAnimationListener initWithManager:WebKit::began:finished:]): Listener for CAAnimations.
        (-[WebFullScreenManagerAnimationListener animationDidStart:]): Added.
        (-[WebFullScreenManagerAnimationListener animationDidStop:finished:]): Added.
        (-[WebFullScreenManagerAnimationListener invalidate]): Added.
        (WebKit::WebFullScreenManager::create): Now creates a WebFullScreenManagerMac.
        (WebKit::WebFullScreenManagerMac::create): Added.
        (WebKit::WebFullScreenManagerMac::WebFullScreenManagerMac): Added.
        (WebKit::WebFullScreenManagerMac::~WebFullScreenManagerMac): Added.
        (WebKit::WebFullScreenManagerMac::setRootFullScreenLayer): Set up the remote layer host.
        (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Create a CATransform3D
            which will animate the full screen renderer from its initial position to its final one.
        (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.

git-svn-id: svn://svn.chromium.org/blink/trunk@80924 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 42df3182
2011-03-11 Jer Noble <jer.noble@apple.com>
Reviewed by Anders Carlsson.
Hook up new WKFullScreenWindowController functions to WebFullScreenManagerProxy
https://bugs.webkit.org/show_bug.cgi?id=56218
* UIProcess/WebFullScreenManagerProxy.cpp:
* UIProcess/mac/WebFullScreenManagerProxyMac.mm: Added.
(WebKit::WebFullScreenManagerProxy::enterFullScreen): Call into WKFullScreenWindowController.
(WebKit::WebFullScreenManagerProxy::exitFullScreen): Ditto.
(WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Ditto.
(WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Ditto.
(WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Ditto.
(WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Ditto.
(WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Ditto.
(WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Ditto.
(WebKit::WebFullScreenManagerProxy::getFullScreenRect): Ditto.
* UIProcess/API/mac/WKView.mm:
(-[WKView fullScreenWindowController]): Lazily instantiate a WKFullScreenWindowController.
* UIProcess/API/mac/WKViewInternal.h:
2011-03-11 Jer Noble <jer.noble@apple.com>
Reviewed by Anders Carlsson.
......
......@@ -42,6 +42,7 @@
#import "TextChecker.h"
#import "TextCheckerState.h"
#import "WKAPICast.h"
#import "WKFullScreenWindowController.h"
#import "WKPrintingView.h"
#import "WKStringCF.h"
#import "WKTextInputWindowController.h"
......@@ -145,6 +146,10 @@ typedef HashMap<String, ValidationVector> ValidationMap;
#if ENABLE(GESTURE_EVENTS)
id _endGestureMonitor;
#endif
#if ENABLE(FULLSCREEN_API)
RetainPtr<WKFullScreenWindowController> _fullScreenWindowController;
#endif
}
@end
......@@ -2001,6 +2006,17 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
[self _updateGrowBoxForWindowFrameChange];
}
#if ENABLE(FULLSCREEN_API)
- (WKFullScreenWindowController*)fullScreenWindowController
{
if (!_data->_fullScreenWindowController) {
_data->_fullScreenWindowController.adoptNS([[WKFullScreenWindowController alloc] init]);
[_data->_fullScreenWindowController.get() setWebView:self];
}
return _data->_fullScreenWindowController.get();
}
#endif
@end
@implementation WKView (Private)
......
......@@ -30,8 +30,13 @@
namespace WebKit {
class DrawingAreaProxy;
class FindIndicator;
class LayerTreeContext;
}
#if ENABLE(FULLSCREEN_API)
@class WKFullScreenWindowController;
#endif
@interface WKView (Internal)
- (PassOwnPtr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
- (BOOL)_isFocused;
......@@ -64,4 +69,8 @@ namespace WebKit {
- (void)_setDrawingAreaSize:(NSSize)size;
- (void)_didChangeScrollbarsForMainFrame;
#if ENABLE(FULLSCREEN_API)
- (WKFullScreenWindowController*)fullScreenWindowController;
#endif
@end
......@@ -105,42 +105,6 @@ void WebFullScreenManagerProxy::supportsFullScreen(bool& supports)
supports = true;
}
void WebFullScreenManagerProxy::enterFullScreen()
{
}
void WebFullScreenManagerProxy::exitFullScreen()
{
}
void WebFullScreenManagerProxy::beganEnterFullScreenAnimation()
{
}
void WebFullScreenManagerProxy::finishedEnterFullScreenAnimation(bool completed)
{
}
void WebFullScreenManagerProxy::beganExitFullScreenAnimation()
{
}
void WebFullScreenManagerProxy::finishedExitFullScreenAnimation(bool completed)
{
}
void WebFullScreenManagerProxy::enterAcceleratedCompositingMode(const LayerTreeContext& context)
{
}
void WebFullScreenManagerProxy::exitAcceleratedCompositingMode()
{
}
void WebFullScreenManagerProxy::getFullScreenRect(WebCore::IntRect& rect)
{
}
} // namespace WebKit
#endif // ENABLE(FULLSCREEN_API)
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WebFullScreenManagerProxy.h"
#include "LayerTreeContext.h"
#include "WKFullScreenWindowController.h"
#include "WKViewInternal.h"
#if ENABLE(FULLSCREEN_API)
namespace WebKit {
void WebFullScreenManagerProxy::enterFullScreen()
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] enterFullScreen:nil];
}
void WebFullScreenManagerProxy::exitFullScreen()
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] exitFullScreen];
}
void WebFullScreenManagerProxy::beganEnterFullScreenAnimation()
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] beganEnterFullScreenAnimation];
}
void WebFullScreenManagerProxy::finishedEnterFullScreenAnimation(bool completed)
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] finishedEnterFullScreenAnimation:completed];
}
void WebFullScreenManagerProxy::beganExitFullScreenAnimation()
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] beganExitFullScreenAnimation];
}
void WebFullScreenManagerProxy::finishedExitFullScreenAnimation(bool completed)
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] finishedExitFullScreenAnimation:completed];
}
void WebFullScreenManagerProxy::enterAcceleratedCompositingMode(const LayerTreeContext& context)
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] enterAcceleratedCompositingMode:context];
}
void WebFullScreenManagerProxy::exitAcceleratedCompositingMode()
{
if (!m_webView)
return;
[[m_webView fullScreenWindowController] exitAcceleratedCompositingMode];
}
void WebFullScreenManagerProxy::getFullScreenRect(WebCore::IntRect& rect)
{
if (!m_webView)
return;
rect = [[m_webView fullScreenWindowController] getFullScreenRect];
}
} // namespace WebKit
#endif
......@@ -744,6 +744,7 @@
CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; };
CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; };
CDCA85D5132AC2B300E961DF /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDCA85D4132AC2B300E961DF /* IOKit.framework */; };
CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */; };
D3B9484611FF4B6500032B39 /* WebPopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */; };
D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B9484311FF4B6500032B39 /* WebPopupMenu.h */; };
D3B9484811FF4B6500032B39 /* WebSearchPopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */; };
......@@ -1621,6 +1622,7 @@
CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullScreenWindowController.mm; sourceTree = "<group>"; };
CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFullScreenWindowController.h; sourceTree = "<group>"; };
CDCA85D4132AC2B300E961DF /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFullScreenManagerProxyMac.mm; sourceTree = "<group>"; };
D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPopupMenu.cpp; sourceTree = "<group>"; };
D3B9484311FF4B6500032B39 /* WebPopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPopupMenu.h; sourceTree = "<group>"; };
D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSearchPopupMenu.cpp; sourceTree = "<group>"; };
......@@ -2876,6 +2878,7 @@
BCCF085C113F3B7500C650C5 /* mac */ = {
isa = PBXGroup;
children = (
CDCA85DE132AD05300E961DF /* WebFullScreenManagerProxyMac.mm */,
CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */,
CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */,
1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */,
......@@ -4071,6 +4074,7 @@
CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */,
CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */,
CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment