diff options
Diffstat (limited to 'WebKit/android/WebCoreSupport')
-rw-r--r-- | WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp | 31 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/ChromeClientAndroid.h | 6 | ||||
-rw-r--r-- | WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | 1 |
3 files changed, 38 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index 980c03e..ca28932 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -37,7 +37,10 @@ #include "FrameLoader.h" #include "FrameView.h" #include "Geolocation.h" +#include "HTMLMediaElement.h" +#include "HTMLNames.h" #include "Icon.h" +#include "LayerAndroid.h" #include "Page.h" #include "PopupMenuAndroid.h" #include "ScriptController.h" @@ -557,4 +560,32 @@ void ChromeClientAndroid::webAppCanBeInstalled() } #endif +#if ENABLE(VIDEO) +bool ChromeClientAndroid::supportsFullscreenForNode(const Node* node) +{ + return node->hasTagName(HTMLNames::videoTag); +} + +void ChromeClientAndroid::enterFullscreenForNode(Node* node) +{ + if (!node->hasTagName(HTMLNames::videoTag)) + return; + + HTMLMediaElement* videoElement = static_cast<HTMLMediaElement*>(node); + LayerAndroid* layer = videoElement->platformLayer(); + if (!layer) + return; + + FrameView* frameView = m_webFrame->page()->mainFrame()->view(); + android::WebViewCore* core = android::WebViewCore::getWebViewCore(frameView); + if (core) + core->enterFullscreenForVideoLayer(layer->uniqueId()); +} + +void ChromeClientAndroid::exitFullscreenForNode(Node* node) +{ +} +#endif + + } diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h index 6c8aef1..2b6f68a 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h @@ -187,6 +187,12 @@ namespace android { virtual void webAppCanBeInstalled(); #endif +#if ENABLE(VIDEO) + virtual bool supportsFullscreenForNode(const WebCore::Node*); + virtual void enterFullscreenForNode(WebCore::Node*); + virtual void exitFullscreenForNode(WebCore::Node*); +#endif + private: android::WebFrame* m_webFrame; // The Geolocation permissions manager. diff --git a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp index 3abb813..2203ae2 100644 --- a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp +++ b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp @@ -283,6 +283,7 @@ public: bool hasAudio() { return false; } // do not display the audio UI bool hasVideo() { return m_hasVideo; } + bool suppportsFullscreen() { return true; } MediaPlayerVideoPrivate(MediaPlayer* player) : MediaPlayerPrivate(player) { |