Changeset 85699 in webkit
- Timestamp:
- May 3, 2011 6:28:38 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 1 deleted
- 15 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85697 r85699 1 2011-05-02 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Implement FULLSCREEN_API on Windows, Part 3: WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=59845 7 8 Move WebFullScreenController into WebCore to facilitate code sharing between WebKit 9 and WebKit2. WebFullScreenController now uses a Client class to request work on its 10 behalf by WebKit and WebKit2. MediaPlayerPrivateFullscreenWindow now only creates a 11 CALayerHost once a root layer is set, as the CALayerHost was causing child window drawing 12 problems, and because a CALayerHost is overkill if the window is only drawing black to 13 its client area. 14 15 * WebCore.vcproj/WebCore.vcproj: 16 * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp: 17 (WebCore::MediaPlayerPrivateFullscreenWindow::MediaPlayerPrivateFullscreenWindow): Do not create 18 m_layerHost in the constructor. 19 (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow): NULL check m_layerHost. 20 (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer): Lazily instantiate m_layerHost. 21 (WebCore::MediaPlayerPrivateFullscreenWindow::wndProc): NULL check m_layerHost; if a root layer is 22 not present, fill the window with black in WM_PAINT. 23 * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h: 24 * platform/graphics/win/FullScreenController.cpp: Renamed from Source/WebKit/win/WebFullScreenController.cpp. 25 * platform/graphics/win/FullScreenController.h: Renamed from Source/WebKit/win/WebFullScreenController.h. 26 * platform/graphics/win/FullScreenControllerClient.h: Split out from FullScreenController.h 27 (WebCore::FullScreenControllerClient::~FullScreenControllerClient): 28 1 29 2011-05-03 Brady Eidson <beidson@apple.com> 2 30 -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r85382 r85699 24722 24722 > 24723 24723 </File> 24724 24725 24726 24727 24728 24729 24730 24731 24724 <File 24725 RelativePath="..\page\PageSerializer.cpp" 24726 > 24727 </File> 24728 <File 24729 RelativePath="..\page\PageSerializer.h" 24730 > 24731 </File> 24732 24732 <File 24733 24733 RelativePath="..\page\Performance.cpp" … … 27114 27114 <File 27115 27115 RelativePath="..\platform\graphics\win\FontWin.cpp" 27116 > 27117 </File> 27118 <File 27119 RelativePath="..\platform\graphics\win\FullScreenController.cpp" 27120 > 27121 </File> 27122 <File 27123 RelativePath="..\platform\graphics\win\FullScreenController.h" 27124 > 27125 </File> 27126 <File 27127 RelativePath="..\platform\graphics\win\FullScreenControllerClient.h" 27116 27128 > 27117 27129 </File> … … 28953 28965 </File> 28954 28966 <File 28967 RelativePath="..\platform\graphics\filters\arm\FEGaussianBlurNEON.cpp" 28968 > 28969 </File> 28970 <File 28971 RelativePath="..\platform\graphics\filters\arm\FEGaussianBlurNEON.h" 28972 > 28973 </File> 28974 <File 28955 28975 RelativePath="..\platform\graphics\filters\FELighting.cpp" 28956 28976 > … … 28961 28981 </File> 28962 28982 <File 28983 RelativePath="..\platform\graphics\filters\arm\FELightingNEON.cpp" 28984 > 28985 </File> 28986 <File 28987 RelativePath="..\platform\graphics\filters\arm\FELightingNEON.h" 28988 > 28989 </File> 28990 <File 28963 28991 RelativePath="..\platform\graphics\filters\FEMerge.cpp" 28964 28992 > … … 29058 29086 <File 29059 29087 RelativePath="..\platform\graphics\filters\SpotLightSource.h" 29060 >29061 </File>29062 <File29063 RelativePath="..\platform\graphics\filters\arm\FEGaussianBlurNEON.cpp"29064 >29065 </File>29066 <File29067 RelativePath="..\platform\graphics\filters\arm\FEGaussianBlurNEON.h"29068 >29069 </File>29070 <File29071 RelativePath="..\platform\graphics\filters\arm\FELightingNEON.cpp"29072 >29073 </File>29074 <File29075 RelativePath="..\platform\graphics\filters\arm\FELightingNEON.h"29076 29088 > 29077 29089 </File> … … 42707 42719 </File> 42708 42720 <File 42721 RelativePath="..\dom\DataTransferItem.h" 42722 > 42723 </File> 42724 <File 42709 42725 RelativePath="..\dom\DataTransferItems.cpp" 42710 42726 > … … 42757 42773 /> 42758 42774 </FileConfiguration> 42759 </File>42760 <File42761 RelativePath="..\dom\DataTransferItem.h"42762 >42763 42775 </File> 42764 42776 <File … … 66706 66718 </File> 66707 66719 <File 66720 RelativePath="..\inspector\front-end\UglifyJS\JavaScriptFormatter.js" 66721 > 66722 </File> 66723 <File 66708 66724 RelativePath="..\inspector\front-end\JavaScriptFormatter.js" 66709 66725 > … … 66747 66763 <File 66748 66764 RelativePath="..\inspector\front-end\PanelEnablerView.js" 66749 >66750 </File>66751 <File66752 RelativePath="..\inspector\front-end\UglifyJS\JavaScriptFormatter.js"66753 66765 > 66754 66766 </File> -
trunk/Source/WebCore/platform/graphics/win/FullScreenController.h
r85697 r85699 29 29 #if ENABLE(FULLSCREEN_API) 30 30 31 #include "WebKit.h"32 31 #include <wtf/OwnPtr.h> 33 #include <wtf/RefPtr.h>34 32 35 33 namespace WebCore { 36 class Element;37 }38 34 39 class WebView;35 class FullScreenControllerClient; 40 36 41 class WebFullScreenController {37 class FullScreenController { 42 38 public: 43 WebFullScreenController(WebView*);44 ~ WebFullScreenController();39 FullScreenController(FullScreenControllerClient*); 40 ~FullScreenController(); 45 41 46 42 public: 47 void setElement(PassRefPtr<WebCore::Element>);48 WebCore::Element* element() const;49 50 43 void enterFullScreen(); 51 44 void exitFullScreen(); … … 56 49 class Private; 57 50 friend class Private; 58 OwnPtr< WebFullScreenController::Private> m_private;51 OwnPtr<FullScreenController::Private> m_private; 59 52 }; 53 54 } 60 55 61 56 #endif -
trunk/Source/WebCore/platform/graphics/win/FullScreenControllerClient.h
r85697 r85699 24 24 */ 25 25 26 #ifndef WebFullScreenController_h27 #define WebFullScreenController_h26 #ifndef FullScreenControllerClient_h 27 #define FullScreenControllerClient_h 28 28 29 29 #if ENABLE(FULLSCREEN_API) 30 30 31 #include "WebKit.h" 32 #include <wtf/OwnPtr.h> 33 #include <wtf/RefPtr.h> 31 namespace WebCore { 34 32 35 namespace WebCore { 36 class Element; 33 class FullScreenControllerClient { 34 public: 35 virtual HWND fullScreenClientWindow() const = 0; 36 virtual HWND fullScreenClientParentWindow() const = 0; 37 virtual void fullScreenClientSetParentWindow(HWND) = 0; 38 virtual void fullScreenClientWillEnterFullScreen() = 0; 39 virtual void fullScreenClientDidEnterFullScreen() = 0; 40 virtual void fullScreenClientWillExitFullScreen() = 0; 41 virtual void fullScreenClientDidExitFullScreen() = 0; 42 protected: 43 virtual ~FullScreenControllerClient() { } 44 }; 45 37 46 } 38 39 class WebView;40 41 class WebFullScreenController {42 public:43 WebFullScreenController(WebView*);44 ~WebFullScreenController();45 46 public:47 void setElement(PassRefPtr<WebCore::Element>);48 WebCore::Element* element() const;49 50 void enterFullScreen();51 void exitFullScreen();52 53 bool isFullScreen() const;54 55 protected:56 class Private;57 friend class Private;58 OwnPtr<WebFullScreenController::Private> m_private;59 };60 47 61 48 #endif -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
r84101 r85699 45 45 : m_client(client) 46 46 , m_hwnd(0) 47 #if USE(ACCELERATED_COMPOSITING)48 , m_layerTreeHost(CACFLayerTreeHost::create())49 #endif50 47 { 51 48 } … … 83 80 IntRect monitorRect = mi.rcMonitor; 84 81 85 ::CreateWindowExW(WS_EX_TOOLWINDOW, windowClassName, L"", WS_POPUP | WS_VISIBLE,82 ::CreateWindowExW(WS_EX_TOOLWINDOW, windowClassName, L"", WS_POPUP, 86 83 monitorRect.x(), monitorRect.y(), monitorRect.width(), monitorRect.height(), 87 84 parentHwnd, 0, WebCore::instanceHandle(), this); … … 89 86 90 87 #if USE(ACCELERATED_COMPOSITING) 91 m_layerTreeHost->setWindow(m_hwnd); 88 if (m_layerTreeHost) 89 m_layerTreeHost->setWindow(m_hwnd); 92 90 #endif 93 91 … … 106 104 m_rootChild = rootChild; 107 105 108 if (!m_rootChild) 109 return; 106 if (!m_rootChild) { 107 m_layerTreeHost = nullptr; 108 return; 109 } 110 111 if (!m_layerTreeHost) { 112 m_layerTreeHost = CACFLayerTreeHost::create(); 113 if (m_hwnd) 114 m_layerTreeHost->setWindow(m_hwnd); 115 } 110 116 111 117 m_layerTreeHost->setRootChildLayer(m_rootChild.get()); … … 149 155 m_hwnd = 0; 150 156 #if USE(ACCELERATED_COMPOSITING) 151 m_layerTreeHost->setWindow(0); 157 if (m_layerTreeHost) 158 m_layerTreeHost->setWindow(0); 152 159 #endif 153 160 break; … … 158 165 break; 159 166 #if USE(ACCELERATED_COMPOSITING) 160 m_layerTreeHost->resize(); 161 PlatformCALayer* rootLayer = m_rootChild->rootLayer(); 162 CGRect rootBounds = m_rootChild->rootLayer()->bounds(); 163 m_rootChild->setFrame(rootBounds); 164 m_rootChild->setNeedsLayout(); 167 if (m_layerTreeHost) { 168 m_layerTreeHost->resize(); 169 PlatformCALayer* rootLayer = m_rootChild->rootLayer(); 170 CGRect rootBounds = m_rootChild->rootLayer()->bounds(); 171 m_rootChild->setFrame(rootBounds); 172 m_rootChild->setNeedsLayout(); 173 } 165 174 #endif 166 175 } … … 168 177 case WM_PAINT: 169 178 #if USE(ACCELERATED_COMPOSITING) 170 m_layerTreeHost->paint(); 171 ::ValidateRect(m_hwnd, 0); 172 #endif 173 break; 174 } 175 179 if (m_layerTreeHost) { 180 m_layerTreeHost->paint(); 181 ::ValidateRect(m_hwnd, 0); 182 } else 183 #endif 184 { 185 PAINTSTRUCT ps; 186 HDC hdc = ::BeginPaint(m_hwnd, &ps); 187 ::FillRect(hdc, &ps.rcPaint, (HBRUSH)::GetStockObject(BLACK_BRUSH)); 188 ::EndPaint(m_hwnd, &ps); 189 } 190 break; 191 case WM_PRINTCLIENT: 192 { 193 RECT clientRect; 194 HDC context = (HDC)wParam; 195 ::GetClientRect(m_hwnd, &clientRect); 196 ::FillRect(context, &clientRect, (HBRUSH)::GetStockObject(BLACK_BRUSH)); 197 } 198 } 176 199 if (m_client) 177 200 lResult = m_client->fullscreenClientWndProc(hWnd, message, wParam, lParam); -
trunk/Source/WebKit/win/ChangeLog
r85691 r85699 1 2011-05-02 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Implement FULLSCREEN_API on Windows, Part 3: WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=59845 7 8 Implementation of WebFullScreenController has been moved into WebCore, and 9 required virutal functions of WebFullScreenControllerClient have been added to 10 WebView. These functions are mostly simple accessors of existing ivars, but 11 m_fullScreenElement and its accessors have also been added to WebView. 12 13 * WebCoreSupport/WebChromeClient.cpp: 14 (WebChromeClient::enterFullScreenForElement): 15 * WebFullScreenController.cpp: Removed. 16 * WebKit.vcproj/WebKit.vcproj: 17 * WebView.cpp: 18 (WebView::setFullScreenElement): Added accessor. 19 (WebVIew::fullScreenElement): Ditto. 20 (WebView::fullScreenClientWindow): Ditto. 21 (WebView::fullScreenClientParentWindow): Ditto. 22 (WebView::fullScreenClientSetParentWindow): Ditto. 23 (WebView::fullScreenClientWillEnterFullScreen): Pass through to Document. 24 (WebView::fullScreenClientDidEnterFullScreen): Ditto. 25 (WebView::fullScreenClientWillExitFullScreen): Ditto. 26 (WebView::fullScreenClientDidExitFullScreen): Ditto. 27 * WebView.h: 28 1 29 2011-05-03 Brian Weinstein <bweinstein@apple.com> 2 30 -
trunk/Source/WebKit/win/FullscreenVideoController.cpp
r85653 r85699 278 278 279 279 m_fullscreenWindow->createWindow(parentHwnd); 280 ::ShowWindow(m_fullscreenWindow->hwnd(), SW_SHOW); 280 281 #if USE(ACCELERATED_COMPOSITING) 281 282 m_fullscreenWindow->setRootChildLayer(m_rootChild); -
trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
r85393 r85699 36 36 #include "WebMutableURLRequest.h" 37 37 #include "WebDesktopNotificationsDelegate.h" 38 #include "WebFullScreenController.h"39 38 #include "WebSecurityOrigin.h" 40 39 #include "WebView.h" … … 47 46 #include <WebCore/FrameLoadRequest.h> 48 47 #include <WebCore/FrameView.h> 48 #include <WebCore/FullScreenController.h> 49 49 #include <WebCore/HTMLNames.h> 50 50 #include <WebCore/Icon.h> … … 905 905 } 906 906 907 m_webView-> fullScreenController()->setElement(element);907 m_webView->setFullScreenElement(element); 908 908 m_webView->fullScreenController()->enterFullScreen(); 909 909 } … … 919 919 } 920 920 921 ASSERT(element == m_webView->fullScreen Controller()->element());921 ASSERT(element == m_webView->fullScreenElement()); 922 922 m_webView->fullScreenController()->exitFullScreen(); 923 923 } -
trunk/Source/WebKit/win/WebKit.vcproj/WebKit.vcproj
r85393 r85699 513 513 </File> 514 514 <File 515 RelativePath="..\WebFullScreenController.h"516 >517 </File>518 <File519 515 RelativePath="..\WebGeolocationPolicyListener.h" 520 516 > … … 930 926 <File 931 927 RelativePath="..\WebFramePolicyListener.cpp" 932 >933 </File>934 <File935 RelativePath="..\WebFullScreenController.cpp"936 928 > 937 929 </File> -
trunk/Source/WebKit/win/WebView.cpp
r85684 r85699 163 163 164 164 #if ENABLE(FULLSCREEN_API) 165 #include "WebFullScreenController.h"165 #include <WebCore/FullScreenController.h> 166 166 #endif 167 167 … … 6776 6776 } 6777 6777 6778 WebFullScreenController* WebView::fullScreenController()6778 FullScreenController* WebView::fullScreenController() 6779 6779 { 6780 6780 if (!m_fullscreenController) 6781 m_fullscreenController = adoptPtr(new WebFullScreenController(this));6781 m_fullscreenController = adoptPtr(new FullScreenController(this)); 6782 6782 return m_fullscreenController.get(); 6783 6783 } 6784 6785 void WebView::setFullScreenElement(PassRefPtr<Element> element) 6786 { 6787 m_fullScreenElement = element; 6788 } 6789 6790 HWND WebView::fullScreenClientWindow() const 6791 { 6792 return m_viewWindow; 6793 } 6794 6795 HWND WebView::fullScreenClientParentWindow() const 6796 { 6797 return m_hostWindow; 6798 } 6799 6800 void WebView::fullScreenClientSetParentWindow(HWND hostWindow) 6801 { 6802 setHostWindow(reinterpret_cast<OLE_HANDLE>(hostWindow)); 6803 } 6804 6805 void WebView::fullScreenClientWillEnterFullScreen() 6806 { 6807 ASSERT(m_fullScreenElement); 6808 m_fullScreenElement->document()->webkitWillEnterFullScreenForElement(m_fullScreenElement.get()); 6809 } 6810 6811 void WebView::fullScreenClientDidEnterFullScreen() 6812 { 6813 ASSERT(m_fullScreenElement); 6814 m_fullScreenElement->document()->webkitDidEnterFullScreenForElement(m_fullScreenElement.get()); 6815 } 6816 6817 void WebView::fullScreenClientWillExitFullScreen() 6818 { 6819 ASSERT(m_fullScreenElement); 6820 m_fullScreenElement->document()->webkitWillExitFullScreenForElement(m_fullScreenElement.get()); 6821 } 6822 6823 void WebView::fullScreenClientDidExitFullScreen() 6824 { 6825 ASSERT(m_fullScreenElement); 6826 m_fullScreenElement->document()->webkitDidExitFullScreenForElement(m_fullScreenElement.get()); 6827 m_fullScreenElement = nullptr; 6828 } 6829 6830 6784 6831 #endif -
trunk/Source/WebKit/win/WebView.h
r85684 r85699 15 15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 16 16 * EXPRESS OR IMPLIED WARRANTIES, INCfLUDING, BUT NOT LIMITED TO, THE 17 * IMPLIED WARRANTIES OF MERCHANTABI LITY AND FITNESS FOR A PARTICULAR17 * IMPLIED WARRANTIES OF MERCHANTABIuLITY AND FITNESS FOR A PARTICULAR 18 18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 19 19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, … … 45 45 #include <WebCore/CACFLayerTreeHostClient.h> 46 46 #include <WebCore/GraphicsLayerClient.h> 47 #endif 48 49 #if ENABLE(FULLSCREEN_API) 50 #include <WebCore/FullScreenControllerClient.h> 51 #endif 47 52 48 53 namespace WebCore { 54 #if USE(ACCELERATED_COMPOSITING) 49 55 class CACFLayerTreeHost; 56 #endif 57 class FullScreenController; 50 58 } 51 #endif52 59 53 60 namespace WebCore { … … 58 65 class WebBackForwardList; 59 66 class WebFrame; 60 class WebFullScreenController;61 67 class WebInspector; 62 68 class WebInspectorClient; 63 64 #if ENABLE(FULLSCREEN_API)65 class WebFullScreenController;66 #endif67 69 68 70 typedef WebCore::RefCountedGDIHandle<HBITMAP> RefCountedHBITMAP; … … 88 90 , WebCore::GraphicsLayerClient 89 91 , WebCore::CACFLayerTreeHostClient 92 #endif 93 #if ENABLE(FULLSCREEN_API) 94 , WebCore::FullScreenControllerClient 90 95 #endif 91 96 { … … 951 956 bool supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard) const; 952 957 bool isFullScreen() const; 953 WebFullScreenController* fullScreenController(); 958 WebCore::FullScreenController* fullScreenController(); 959 void setFullScreenElement(PassRefPtr<WebCore::Element>); 960 WebCore::Element* fullScreenElement() const { return m_fullScreenElement.get(); } 954 961 #endif 955 962 … … 1016 1023 1017 1024 virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM); 1025 1026 #if ENABLE(FULLSCREEN_API) 1027 virtual HWND fullScreenClientWindow() const; 1028 virtual HWND fullScreenClientParentWindow() const; 1029 virtual void fullScreenClientSetParentWindow(HWND); 1030 virtual void fullScreenClientWillEnterFullScreen(); 1031 virtual void fullScreenClientDidEnterFullScreen(); 1032 virtual void fullScreenClientWillExitFullScreen(); 1033 virtual void fullScreenClientDidExitFullScreen(); 1034 #endif 1018 1035 1019 1036 ULONG m_refCount; … … 1110 1127 1111 1128 #if ENABLE(FULLSCREEN_API) 1112 OwnPtr<WebFullScreenController> m_fullscreenController; 1129 RefPtr<WebCore::Element> m_fullScreenElement; 1130 OwnPtr<WebCore::FullScreenController> m_fullscreenController; 1113 1131 #endif 1114 1132 }; -
trunk/Source/WebKit2/ChangeLog
r85697 r85699 1 2011-05-02 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Adam Roben. 4 5 Implement FULLSCREEN_API on Windows, Part 3: WebKit2 6 https://bugs.webkit.org/show_bug.cgi?id=59845 7 8 Implement a similar full screen mode to WebKit; Re-use the same 9 full screen window class used in WebKit in the new WebFullScreenController. 10 No animations (yet), so many of the stubs remain unimplemented. 11 12 * UIProcess/win/WebView.cpp: 13 (WebKit::WebView::onKeyEvent): Handle VK_ESCAPE and cancel full screen 14 mode if caught. 15 (WebKit::WebView::fullScreenController): Lazily instantiate m_fullScreenController. 16 (WebKit::WebView::fullScreenClientWindow): Added accessor. 17 (WebKit::WebView::fullScreenClientParentWindow): Ditto. 18 (WebKit::WebView::fullScreenClientSetParentWindow): Ditto. 19 (WebKit::WebView::fullScreenClientWillEnterFullScreen): Pass through to WebFullScreenManagerProxy. 20 (WebKit::WebView::fullScreenClientDidEnterFullScreen): Ditto. 21 (WebKit::WebView::fullScreenClientWillExitFullScreen): Ditto. 22 (WebKit::WebView::fullScreenClientDidExitFullScreen): Ditto. 23 * UIProcess/win/WebView.h: 24 * UIProcess/win/WebFullScreenManagerProxyWin.cpp: 25 (WebKit::WebFullScreenManagerProxy::enterFullScreen): Pass through to 26 WebFullScreenController. 27 (WebKit::WebFullScreenManagerProxy::exitFullScreen): Ditto. 28 * UIProcess/win/WebView.cpp: 29 (WebKit::WebView::WebView): 30 (WebKit::WebView::onKeyEvent): Handle the escape key and exit 31 full screen mode when detected. 32 (WebKit::WebView::fullScreenWindowController): Added. 33 * UIProcess/win/WebView.h: 34 * WebProcess/FullScreen/win/WebFullScreenManagerWin.cpp: 35 (WebKit::WebFullScreenManagerWin::~WebFullScreenManagerWin): 36 (WebKit::WebFullScreenManagerWin::setRootFullScreenLayer): Host the root 37 full screen layer if it gets detached. 38 * WebProcess/FullScreen/win/WebFullScreenManagerWin.h: 39 * win/WebKit2.vcproj: 40 1 41 2011-05-03 Brady Eidson <beidson@apple.com> 2 42 -
trunk/Source/WebKit2/UIProcess/win/WebFullScreenManagerProxyWin.cpp
r85389 r85699 29 29 #if ENABLE(FULLSCREEN_API) 30 30 31 #include "WebView.h" 32 #include <WebCore/FullScreenController.h> 31 33 #include <WebCore/IntRect.h> 32 34 … … 37 39 if (!m_webView) 38 40 return; 39 // FIXME: Implement41 m_webView->fullScreenController()->enterFullScreen(); 40 42 } 41 43 … … 44 46 if (!m_webView) 45 47 return; 46 // FIXME: Implement48 m_webView->fullScreenController()->exitFullScreen(); 47 49 } 48 50 -
trunk/Source/WebKit2/UIProcess/win/WebView.cpp
r84304 r85699 56 56 #include <wtf/text/WTFString.h> 57 57 58 #if ENABLE(FULLSCREEN_API) 59 #include "WebFullScreenManagerProxy.h" 60 #include <WebCore/FullScreenController.h> 61 #endif 62 58 63 namespace Ime { 59 64 // We need these functions in a separate namespace, because in the global namespace they conflict … … 300 305 // Initialize the top level parent window and register it with the WindowMessageBroadcaster. 301 306 windowAncestryDidChange(); 307 308 #if ENABLE(FULLSCREEN_API) 309 m_page->fullScreenManager()->setWebView(this); 310 #endif 302 311 } 303 312 … … 609 618 LRESULT WebView::onKeyEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled) 610 619 { 620 #if ENABLE(FULLSCREEN_API) 621 // Trap the ESC key when in full screen mode. 622 if (message == WM_KEYDOWN && wParam == VK_ESCAPE && m_fullScreenController && m_fullScreenController->isFullScreen()) { 623 m_fullScreenController->exitFullScreen(); 624 return false; 625 } 626 #endif 627 611 628 m_page->handleKeyboardEvent(NativeWebKeyboardEvent(hWnd, message, wParam, lParam)); 612 629 … … 1651 1668 } 1652 1669 1670 #if ENABLE(FULLSCREEN_API) 1671 FullScreenController* WebView::fullScreenController() 1672 { 1673 if (!m_fullScreenController) 1674 m_fullScreenController = adoptPtr(new FullScreenController(this)); 1675 return m_fullScreenController.get(); 1676 } 1677 1678 HWND WebView::fullScreenClientWindow() const 1679 { 1680 return m_window; 1681 } 1682 1683 HWND WebView::fullScreenClientParentWindow() const 1684 { 1685 return ::GetParent(m_window); 1686 } 1687 1688 void WebView::fullScreenClientSetParentWindow(HWND hostWindow) 1689 { 1690 setParentWindow(hostWindow); 1691 } 1692 1693 void WebView::fullScreenClientWillEnterFullScreen() 1694 { 1695 page()->fullScreenManager()->willEnterFullScreen(); 1696 } 1697 1698 void WebView::fullScreenClientDidEnterFullScreen() 1699 { 1700 page()->fullScreenManager()->didEnterFullScreen(); 1701 } 1702 1703 void WebView::fullScreenClientWillExitFullScreen() 1704 { 1705 page()->fullScreenManager()->willExitFullScreen(); 1706 } 1707 1708 void WebView::fullScreenClientDidExitFullScreen() 1709 { 1710 page()->fullScreenManager()->didExitFullScreen(); 1711 } 1712 1713 #endif 1653 1714 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/win/WebView.h
r84064 r85699 41 41 #include <wtf/RefPtr.h> 42 42 43 #if ENABLE(FULLSCREEN_API) 44 #include <WebCore/FullScreenControllerClient.h> 45 #endif 46 47 namespace WebCore { 48 class FullScreenController; 49 } 50 43 51 interface IDropTargetHelper; 44 52 … … 47 55 class DrawingAreaProxy; 48 56 49 class WebView : public APIObject, public PageClient, WebCore::WindowMessageListener, public IDropTarget { 57 class WebView 58 : public APIObject 59 , public PageClient 60 , WebCore::WindowMessageListener 61 , public IDropTarget 62 #if ENABLE(FULLSCREEN_API) 63 , WebCore::FullScreenControllerClient 64 #endif 65 { 50 66 public: 51 67 static PassRefPtr<WebView> create(RECT rect, WebContext* context, WebPageGroup* pageGroup, HWND parentWindow) … … 85 101 86 102 WebPageProxy* page() const { return m_page.get(); } 103 104 #if ENABLE(FULLSCREEN_API) 105 WebCore::FullScreenController* fullScreenController(); 106 #endif 87 107 88 108 private: … … 196 216 virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM); 197 217 218 #if ENABLE(FULLSCREEN_API) 219 virtual HWND fullScreenClientWindow() const; 220 virtual HWND fullScreenClientParentWindow() const; 221 virtual void fullScreenClientSetParentWindow(HWND); 222 virtual void fullScreenClientWillEnterFullScreen(); 223 virtual void fullScreenClientDidEnterFullScreen(); 224 virtual void fullScreenClientWillExitFullScreen(); 225 virtual void fullScreenClientDidExitFullScreen(); 226 #endif 227 198 228 HWND m_window; 199 229 HWND m_topLevelParentWindow; … … 235 265 236 266 bool m_gestureReachedScrollingLimit; 267 268 #if ENABLE(FULLSCREEN_API) 269 OwnPtr<WebCore::FullScreenController> m_fullScreenController; 270 #endif 237 271 }; 238 272 -
trunk/Source/WebKit2/WebProcess/FullScreen/win/WebFullScreenManagerWin.cpp
r85389 r85699 33 33 #include "WebPage.h" 34 34 #include "WebProcess.h" 35 #include <WebCore/Frame.h> 36 #include <WebCore/FrameView.h> 37 #include <WebCore/GraphicsLayer.h> 38 #include <WebCore/Page.h> 35 39 #include <WebKitSystemInterface/WebKitSystemInterface.h> 36 40 … … 56 60 WebFullScreenManagerWin::~WebFullScreenManagerWin() 57 61 { 62 m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode()); 58 63 } 59 64 60 void WebFullScreenManagerWin::setRootFullScreenLayer(WebCore::GraphicsLayer* )65 void WebFullScreenManagerWin::setRootFullScreenLayer(WebCore::GraphicsLayer* layer) 61 66 { 62 // FIXME: Implement 67 // Host the full screen layer if its given to us; otherwise it will be disconnected 68 // from the layer heirarchy and cause an ASSERT during resync. 69 // FIXME: Disable setting RenderLayer::setAnimating() to make this unnecessary. 70 if (m_fullScreenRootLayer == layer) 71 return; 72 m_fullScreenRootLayer = layer; 73 74 if (!m_fullScreenRootLayer) { 75 m_page->send(Messages::WebFullScreenManagerProxy::ExitAcceleratedCompositingMode()); 76 if (m_rootLayer) { 77 m_rootLayer->removeAllChildren(); 78 m_rootLayer = 0; 79 } 80 return; 81 } 82 83 if (!m_rootLayer) { 84 m_rootLayer = GraphicsLayer::create(0); 85 #ifndef NDEBUG 86 m_rootLayer->setName("Full screen root layer"); 87 #endif 88 m_rootLayer->setDrawsContent(false); 89 m_rootLayer->setSize(getFullScreenRect().size()); 90 } 91 92 m_rootLayer->removeAllChildren(); 93 94 if (m_fullScreenRootLayer) 95 m_rootLayer->addChild(m_fullScreenRootLayer); 96 97 m_rootLayer->syncCompositingStateForThisLayerOnly(); 98 m_page->corePage()->mainFrame()->view()->syncCompositingStateIncludingSubframes(); 63 99 } 64 100 65 101 void WebFullScreenManagerWin::beginEnterFullScreenAnimation(float) 66 102 { 67 // FIXME: Implement103 // FIXME: Add support for animating the content into full screen. 68 104 } 69 105 70 106 void WebFullScreenManagerWin::beginExitFullScreenAnimation(float) 71 107 { 72 // FIXME: Implement108 // FIXME: Add support for animating the content into full screen. 73 109 } 74 110 -
trunk/Source/WebKit2/WebProcess/FullScreen/win/WebFullScreenManagerWin.h
r85389 r85699 46 46 virtual void beginEnterFullScreenAnimation(float duration); 47 47 virtual void beginExitFullScreenAnimation(float duration); 48 49 OwnPtr<WebCore::GraphicsLayer> m_rootLayer; 50 WebCore::GraphicsLayer* m_fullScreenRootLayer; 48 51 }; 49 52
Note: See TracChangeset
for help on using the changeset viewer.