diff options
author | Nicolas Roard <nicolas@android.com> | 2011-03-11 15:54:02 -0800 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2011-03-11 15:54:02 -0800 |
commit | f3a31eb2e1d301a9ceb62e99250c1d5e19814c66 (patch) | |
tree | baab716fe6f898d383404db07f13b9f447fee191 /WebKit/android | |
parent | 2dd2637428709f3c4cced21e274798afb2233fae (diff) | |
parent | 24e276c8e5227205806807e70f5774218c0c0d1f (diff) | |
download | external_webkit-f3a31eb2e1d301a9ceb62e99250c1d5e19814c66.zip external_webkit-f3a31eb2e1d301a9ceb62e99250c1d5e19814c66.tar.gz external_webkit-f3a31eb2e1d301a9ceb62e99250c1d5e19814c66.tar.bz2 |
resolved conflicts for merge of 24e276c8 to master
Change-Id: I1f46d4444330bf7e03b99a5d0089e9388b9ea8bd
Diffstat (limited to 'WebKit/android')
-rw-r--r-- | WebKit/android/RenderSkinMediaButton.cpp | 1 | ||||
-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 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 14 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 5 |
6 files changed, 58 insertions, 0 deletions
diff --git a/WebKit/android/RenderSkinMediaButton.cpp b/WebKit/android/RenderSkinMediaButton.cpp index 9055e89..933b75b 100644 --- a/WebKit/android/RenderSkinMediaButton.cpp +++ b/WebKit/android/RenderSkinMediaButton.cpp @@ -116,6 +116,7 @@ void RenderSkinMediaButton::Draw(SkCanvas* canvas, const IntRect& r, int buttonT } case BACKGROUND_SLIDER: { + drawsBackgroundColor = false; drawsImage = false; drawsNinePatch = false; drawsBackgroundColor = true; 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) { diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 34179f2..c956b39 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -299,6 +299,7 @@ struct WebViewCore::JavaGlue { jmethodID m_centerFitRect; jmethodID m_setScrollbarModes; jmethodID m_setInstallableWebApp; + jmethodID m_enterFullscreenForVideoLayer; jmethodID m_setWebTextViewAutoFillable; jmethodID m_selectAt; AutoJObject object(JNIEnv* env) { @@ -396,6 +397,9 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_centerFitRect = GetJMethod(env, clazz, "centerFitRect", "(IIII)V"); m_javaGlue->m_setScrollbarModes = GetJMethod(env, clazz, "setScrollbarModes", "(II)V"); m_javaGlue->m_setInstallableWebApp = GetJMethod(env, clazz, "setInstallableWebApp", "()V"); +#if ENABLE(VIDEO) + m_javaGlue->m_enterFullscreenForVideoLayer = GetJMethod(env, clazz, "enterFullscreenForVideoLayer", "(I)V"); +#endif m_javaGlue->m_setWebTextViewAutoFillable = GetJMethod(env, clazz, "setWebTextViewAutoFillable", "(ILjava/lang/String;)V"); m_javaGlue->m_selectAt = GetJMethod(env, clazz, "selectAt", "(II)V"); env->DeleteLocalRef(clazz); @@ -3608,6 +3612,16 @@ void WebViewCore::notifyWebAppCanBeInstalled() checkException(env); } +#if ENABLE(VIDEO) +void WebViewCore::enterFullscreenForVideoLayer(int layerId) +{ + JNIEnv* env = JSC::Bindings::getJNIEnv(); + env->CallVoidMethod(m_javaGlue->object(env).get(), + m_javaGlue->m_enterFullscreenForVideoLayer, layerId); + checkException(env); +} +#endif + void WebViewCore::setWebTextViewAutoFillable(int queryId, const string16& previewSummary) { #if ENABLE(WEB_AUTOFILL) diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index df7169d..74f4064 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -539,6 +539,11 @@ namespace android { void splitContent(PictureSet*); void notifyWebAppCanBeInstalled(); + +#if ENABLE(VIDEO) + void enterFullscreenForVideoLayer(int layerId); +#endif + void setWebTextViewAutoFillable(int queryId, const string16& previewSummary); DeviceMotionAndOrientationManager* deviceMotionAndOrientationManager() { return &m_deviceMotionAndOrientationManager; } |