1/* 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 14 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 15 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 17 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 23 * THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#import "config.h" 27#import "WebFullScreenManagerProxy.h" 28 29#import "LayerTreeContext.h" 30#import "WKFullScreenWindowController.h" 31#import "WKViewInternal.h" 32#import <WebCore/IntRect.h> 33 34#if ENABLE(FULLSCREEN_API) 35 36namespace WebKit { 37 38void WebFullScreenManagerProxy::enterFullScreen() 39{ 40 if (!m_webView) 41 return; 42 [[m_webView fullScreenWindowController] enterFullScreen:nil]; 43} 44 45void WebFullScreenManagerProxy::exitFullScreen() 46{ 47 if (!m_webView) 48 return; 49 [[m_webView fullScreenWindowController] exitFullScreen]; 50} 51 52void WebFullScreenManagerProxy::beganEnterFullScreenAnimation() 53{ 54 if (!m_webView) 55 return; 56 [[m_webView fullScreenWindowController] beganEnterFullScreenAnimation]; 57} 58 59void WebFullScreenManagerProxy::finishedEnterFullScreenAnimation(bool completed) 60{ 61 if (!m_webView) 62 return; 63 [[m_webView fullScreenWindowController] finishedEnterFullScreenAnimation:completed]; 64} 65 66void WebFullScreenManagerProxy::beganExitFullScreenAnimation() 67{ 68 if (!m_webView) 69 return; 70 [[m_webView fullScreenWindowController] beganExitFullScreenAnimation]; 71} 72 73void WebFullScreenManagerProxy::finishedExitFullScreenAnimation(bool completed) 74{ 75 if (!m_webView) 76 return; 77 [[m_webView fullScreenWindowController] finishedExitFullScreenAnimation:completed]; 78} 79 80void WebFullScreenManagerProxy::enterAcceleratedCompositingMode(const LayerTreeContext& context) 81{ 82 if (!m_webView) 83 return; 84 [[m_webView fullScreenWindowController] enterAcceleratedCompositingMode:context]; 85} 86 87void WebFullScreenManagerProxy::exitAcceleratedCompositingMode() 88{ 89 if (!m_webView) 90 return; 91 [[m_webView fullScreenWindowController] exitAcceleratedCompositingMode]; 92} 93 94void WebFullScreenManagerProxy::getFullScreenRect(WebCore::IntRect& rect) 95{ 96 if (!m_webView) 97 return; 98 rect = [[m_webView fullScreenWindowController] getFullScreenRect]; 99} 100 101} // namespace WebKit 102 103#endif 104