Changeset 85389 in webkit


Ignore:
Timestamp:
Apr 29, 2011 9:30:09 PM (13 years ago)
Author:
jer.noble@apple.com
Message:

2011-04-28 Jer Noble <jer.noble@apple.com>

Reviewed by Jon Honeycutt.

Implement FULLSCREEN_API on Windows, Part 1: Stubs
https://bugs.webkit.org/show_bug.cgi?id=59778

Create all the stubs necessary to for enabling FULLSCREEN_API
on Windows. This includes the COM interfaces for preferences and
for overriding full screen behavior in a UI Delegate.

  • Interfaces/IWebPreferencesPrivate.idl: Add functions for enabling

full screen preference.

  • Interfaces/IWebUIDelegatePrivate.idl: Add functions for overriding

full screen behavior.

  • WebCoreSupport/WebChromeClient.cpp: (WebChromeClient::supportsFullScreenForElement): Added. (WebChromeClient::enterFullScreenForElement): Added. (WebChromeClient::exitFullScreenForElement): Added.
  • WebCoreSupport/WebChromeClient.h:
  • WebPreferenceKeysPrivate.h: Added WebKitFullScreenEnable key.
  • WebPreferences.cpp: (WebPreferences::isFullScreenEnabled): Added. Implements function

defined in IWebUIDelegatePrivate.

(WebPreferences::setFullScreenEnabled): Ditto.

  • WebPreferences.h:

2011-04-28 Jer Noble <jer.noble@apple.com>

Reviewed by Jon Honeycutt.

Implement FULLSCREEN_API on Windows, Part 1: Stubs
https://bugs.webkit.org/show_bug.cgi?id=59778

Add Windows specific stubs for WebKit2 full screen APIs.

  • UIProcess/win/WebFullScreenManagerProxyWin.cpp: Added. (WebKit::WebFullScreenManagerProxy::enterFullScreen): Added stub. (WebKit::WebFullScreenManagerProxy::exitFullScreen): Added stub. (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Added stub. (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Added stub. (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Added stub. (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Added stub. (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Added stub. (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Added stub. (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Added stub.
  • WebProcess/FullScreen/win/WebFullScreenManagerWin.cpp: Added. (WebKit::WebFullScreenManager::create): Added. Returns a WebFullScreenManagerWin. (WebKit::WebFullScreenManagerWin::create): Added. (WebKit::WebFullScreenManagerWin::WebFullScreenManagerWin): Added. (WebKit::WebFullScreenManagerWin::~WebFullScreenManagerWin): Added. (WebKit::WebFullScreenManagerWin::setRootFullScreenLayer): Added stub. (WebKit::WebFullScreenManagerWin::beginEnterFullScreenAnimation): Added stub. (WebKit::WebFullScreenManagerWin::beginExitFullScreenAnimation): Added stub.
  • WebProcess/FullScreen/win/WebFullScreenManagerWin.h: Added.
  • win/WebKit2.vcproj: Added new classes.
Location:
trunk/Source
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/fullscreen.css

    r84706 r85389  
    3737    bottom: 0px;
    3838}
     39
  • trunk/Source/WebKit/win/ChangeLog

    r85256 r85389  
     12011-04-28  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Jon Honeycutt.
     4
     5        Implement FULLSCREEN_API on Windows, Part 1: Stubs
     6        https://bugs.webkit.org/show_bug.cgi?id=59778
     7
     8        Create all the stubs necessary to for enabling FULLSCREEN_API
     9        on Windows. This includes the COM interfaces for preferences and
     10        for overriding full screen behavior in a UI Delegate.
     11
     12        * Interfaces/IWebPreferencesPrivate.idl: Add functions for enabling
     13            full screen preference.
     14        * Interfaces/IWebUIDelegatePrivate.idl: Add functions for overriding
     15            full screen behavior.
     16        * WebCoreSupport/WebChromeClient.cpp:
     17        (WebChromeClient::supportsFullScreenForElement): Added.
     18        (WebChromeClient::enterFullScreenForElement): Added.
     19        (WebChromeClient::exitFullScreenForElement): Added.
     20        * WebCoreSupport/WebChromeClient.h:
     21        * WebPreferenceKeysPrivate.h: Added WebKitFullScreenEnable key.
     22        * WebPreferences.cpp:
     23        (WebPreferences::isFullScreenEnabled): Added. Implements function
     24           defined in IWebUIDelegatePrivate.
     25        (WebPreferences::setFullScreenEnabled): Ditto.
     26        * WebPreferences.h:
     27
    1282011-04-28  Adam Barth  <abarth@webkit.org>
    229
  • trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl

    r83628 r85389  
    125125    HRESULT setLoadsSiteIconsIgnoringImageLoadingPreference([in] BOOL enabled);
    126126    HRESULT loadsSiteIconsIgnoringImageLoadingPreference([out, retval] BOOL* enabled);
     127
     128    HRESULT setFullScreenEnabled([in] BOOL enabled);
     129    HRESULT isFullScreenEnabled([out, retval] BOOL* enabled);
    127130}
  • trunk/Source/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl

    r62451 r85389  
    111111    HRESULT didPressMissingPluginButton([in] IDOMElement*);
    112112}
     113
     114[
     115    object,
     116    oleautomation,
     117    uuid(944e8e46-6d63-450f-b381-c5d68b80b727),
     118    pointer_default(unique)
     119]
     120interface IWebUIDelegatePrivate4 : IWebUIDelegatePrivate3
     121{
     122    HRESULT supportsFullScreenForElement([in] IDOMElement*, [in] BOOL withKeyboard, [out, retval] BOOL* supports);
     123    HRESULT enterFullScreenForElement([in] IDOMElement*);
     124    HRESULT exitFullScreenForElement([in] IDOMElement*);
     125}
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp

    r82284 r85389  
    878878}
    879879
     880#if ENABLE(FULLSCREEN_API)
     881bool WebChromeClient::supportsFullScreenForElement(const Element* element, bool requestingKeyboardAccess)
     882{
     883    COMPtr<IWebUIDelegate> uiDelegate;
     884    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
     885        COMPtr<IWebUIDelegatePrivate4> uiDelegatePrivate4(Query, uiDelegate);
     886        BOOL supports = FALSE;
     887        COMPtr<IDOMElement> domElement(AdoptCOM, DOMElement::createInstance(const_cast<Element*>(element)));
     888
     889        if (uiDelegatePrivate4 && SUCCEEDED(uiDelegatePrivate4->supportsFullScreenForElement(domElement.get(), requestingKeyboardAccess, &supports)))
     890            return supports;
     891    }
     892
     893    return FALSE;
     894}
     895
     896void WebChromeClient::enterFullScreenForElement(Element* element)
     897{
     898    COMPtr<IWebUIDelegate> uiDelegate;
     899    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
     900        COMPtr<IWebUIDelegatePrivate4> uiDelegatePrivate4(Query, uiDelegate);
     901        COMPtr<IDOMElement> domElement(AdoptCOM, DOMElement::createInstance(element));
     902        if (uiDelegatePrivate4 && SUCCEEDED(uiDelegatePrivate4->enterFullScreenForElement(domElement.get())))
     903            return;
     904    }
     905}
     906
     907void WebChromeClient::exitFullScreenForElement(Element* element)
     908{
     909    COMPtr<IWebUIDelegate> uiDelegate;
     910    if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
     911        COMPtr<IWebUIDelegatePrivate4> uiDelegatePrivate4(Query, uiDelegate);
     912        COMPtr<IDOMElement> domElement(AdoptCOM, DOMElement::createInstance(element));
     913        if (uiDelegatePrivate4 && SUCCEEDED(uiDelegatePrivate4->exitFullScreenForElement(domElement.get())))
     914            return;
     915    }
     916}
     917
     918#endif
  • trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h

    r80282 r85389  
    178178    virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const;
    179179
     180#if ENABLE(FULLSCREEN_API)
     181    virtual bool supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard);
     182    virtual void enterFullScreenForElement(WebCore::Element*);
     183    virtual void exitFullScreenForElement(WebCore::Element*);
     184#endif
     185
    180186private:
    181187    COMPtr<IWebUIDelegate> uiDelegate();
  • trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h

    r83628 r85389  
    151151
    152152#define WebKitMemoryInfoEnabledPreferenceKey "WebKitMemoryInfoEnabled"
     153
     154#define WebKitFullScreenEnabledPreferenceKey "WebKitFullScreenEnabled"
  • trunk/Source/WebKit/win/WebPreferences.cpp

    r84146 r85389  
    15291529}
    15301530
     1531HRESULT WebPreferences::isFullScreenEnabled(BOOL* enabled)
     1532{
     1533#if ENABLE(FULLSCREEN_API)
     1534    if (!enabled)
     1535        return E_POINTER;
     1536
     1537    *enabled = boolValueForKey(CFSTR(WebKitFullScreenEnabledPreferenceKey));
     1538    return S_OK;
     1539#else
     1540    return E_NOTIMPL;
     1541#endif
     1542}
     1543
     1544HRESULT WebPreferences::setFullScreenEnabled(BOOL enabled)
     1545{
     1546#if ENABLE(FULLSCREEN_API)
     1547    setBoolValue(CFSTR(WebKitFullScreenEnabledPreferenceKey), enabled);
     1548    return S_OK;
     1549#else
     1550    return E_NOTIMPL;
     1551#endif
     1552}
     1553
    15311554void WebPreferences::willAddToWebView()
    15321555{
  • trunk/Source/WebKit/win/WebPreferences.h

    r83628 r85389  
    433433    virtual HRESULT STDMETHODCALLTYPE setLoadsSiteIconsIgnoringImageLoadingPreference(BOOL);
    434434
     435    virtual HRESULT STDMETHODCALLTYPE setFullScreenEnabled(BOOL);
     436    virtual HRESULT STDMETHODCALLTYPE isFullScreenEnabled(BOOL*);
     437
    435438    // WebPreferences
    436439
  • trunk/Source/WebKit2/ChangeLog

    r85386 r85389  
     12011-04-28  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Jon Honeycutt.
     4
     5        Implement FULLSCREEN_API on Windows, Part 1: Stubs
     6        https://bugs.webkit.org/show_bug.cgi?id=59778
     7
     8        Add Windows specific stubs for WebKit2 full screen APIs.
     9
     10        * UIProcess/win/WebFullScreenManagerProxyWin.cpp: Added.
     11        (WebKit::WebFullScreenManagerProxy::enterFullScreen): Added stub.
     12        (WebKit::WebFullScreenManagerProxy::exitFullScreen): Added stub.
     13        (WebKit::WebFullScreenManagerProxy::beganEnterFullScreenAnimation): Added stub.
     14        (WebKit::WebFullScreenManagerProxy::finishedEnterFullScreenAnimation): Added stub.
     15        (WebKit::WebFullScreenManagerProxy::beganExitFullScreenAnimation): Added stub.
     16        (WebKit::WebFullScreenManagerProxy::finishedExitFullScreenAnimation): Added stub.
     17        (WebKit::WebFullScreenManagerProxy::enterAcceleratedCompositingMode): Added stub.
     18        (WebKit::WebFullScreenManagerProxy::exitAcceleratedCompositingMode): Added stub.
     19        (WebKit::WebFullScreenManagerProxy::getFullScreenRect): Added stub.
     20        * WebProcess/FullScreen/win/WebFullScreenManagerWin.cpp: Added.
     21        (WebKit::WebFullScreenManager::create): Added. Returns a WebFullScreenManagerWin.
     22        (WebKit::WebFullScreenManagerWin::create): Added.
     23        (WebKit::WebFullScreenManagerWin::WebFullScreenManagerWin): Added.
     24        (WebKit::WebFullScreenManagerWin::~WebFullScreenManagerWin): Added.
     25        (WebKit::WebFullScreenManagerWin::setRootFullScreenLayer): Added stub.
     26        (WebKit::WebFullScreenManagerWin::beginEnterFullScreenAnimation): Added stub.
     27        (WebKit::WebFullScreenManagerWin::beginExitFullScreenAnimation): Added stub.
     28        * WebProcess/FullScreen/win/WebFullScreenManagerWin.h: Added.
     29        * win/WebKit2.vcproj: Added new classes.
     30
    1312011-04-29  Alexey Proskuryakov  <ap@apple.com>
    232
  • trunk/Source/WebKit2/win/WebKit2.vcproj

    r84610 r85389  
    21672167                                </File>
    21682168                                <File
     2169                                        RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageFullScreenClient.cpp"
     2170                                        >
     2171                                </File>
     2172                                <File
     2173                                        RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageFullScreenClient.h"
     2174                                        >
     2175                                </File>
     2176                                <File
    21692177                                        RelativePath="..\WebProcess\InjectedBundle\InjectedBundlePageLoaderClient.cpp"
    21702178                                        >
     
    24852493                                                </File>
    24862494                                        </Filter>
     2495                                </Filter>
     2496                        </Filter>
     2497                        <Filter
     2498                                Name="FullScreen"
     2499                                >
     2500                                <File
     2501                                        RelativePath="..\WebProcess\FullScreen\WebFullScreenManager.cpp"
     2502                                        >
     2503                                </File>
     2504                                <File
     2505                                        RelativePath="..\WebProcess\FullScreen\WebFullScreenManager.h"
     2506                                        >
     2507                                </File>
     2508                                <Filter
     2509                                        Name="win"
     2510                                        >
     2511                                        <File
     2512                                                RelativePath="..\WebProcess\FullScreen\win\WebFullScreenManagerWin.cpp"
     2513                                                >
     2514                                        </File>
     2515                                        <File
     2516                                                RelativePath="..\WebProcess\FullScreen\win\WebFullScreenManagerWin.h"
     2517                                                >
     2518                                        </File>
    24872519                                </Filter>
    24882520                        </Filter>
     
    34353467                                </File>
    34363468                                <File
     3469                                        RelativePath="..\UIProcess\win\WebFullScreenManagerProxyWin.cpp"
     3470                                        >
     3471                                </File>
     3472                                <File
    34373473                                        RelativePath="..\UIProcess\win\WebGrammarDetail.cpp"
    34383474                                        >
Note: See TracChangeset for help on using the changeset viewer.