summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2012-01-11 10:54:53 +0000
committerBen Murdoch <benm@google.com>2012-04-13 10:09:03 +0100
commit16e49e63e74d9236b0d8b72846201697a8ebaedc (patch)
treef7a2226792e2d34fed9a65bc6986b120bd0a1277 /Source/WebKit
parentb62fb73a22ae38019efcdb050bf61e0e22327b9d (diff)
downloadexternal_webkit-16e49e63e74d9236b0d8b72846201697a8ebaedc.zip
external_webkit-16e49e63e74d9236b0d8b72846201697a8ebaedc.tar.gz
external_webkit-16e49e63e74d9236b0d8b72846201697a8ebaedc.tar.bz2
Add support for HTML Media Capture "capture" attribute.
Add support in WebKit for the newly specified "capture" attribute to be used on HTML file pickers. Maintains support for the legacy implementation of the API (a MIME type parameter on the 'accept' attribute) for backwards compatibility. Note the 'capture' attribute takes precedent over a MIME type parameter. See http://www.w3.org/TR/html-media-capture/#captureparam for details. Requires changes in the framework (I494adc1274ca21ce8fe52a6c7b6b758217927e66) and Browser (I38dfe2df043fdba1388384dbd3b5370737eb38e5). Bug: 5771207 Change-Id: I0a921be31fda79a43c05da4fe22d9c808d92709c
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index ae00941..7da8103 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -457,7 +457,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m
m_javaGlue->m_scrollTo = GetJMethod(env, clazz, "contentScrollTo", "(IIZZ)V");
m_javaGlue->m_contentDraw = GetJMethod(env, clazz, "contentDraw", "()V");
m_javaGlue->m_requestListBox = GetJMethod(env, clazz, "requestListBox", "([Ljava/lang/String;[I[I)V");
- m_javaGlue->m_openFileChooser = GetJMethod(env, clazz, "openFileChooser", "(Ljava/lang/String;)Ljava/lang/String;");
+ m_javaGlue->m_openFileChooser = GetJMethod(env, clazz, "openFileChooser", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;");
m_javaGlue->m_requestSingleListBox = GetJMethod(env, clazz, "requestListBox", "([Ljava/lang/String;[II)V");
m_javaGlue->m_jsAlert = GetJMethod(env, clazz, "jsAlert", "(Ljava/lang/String;Ljava/lang/String;)V");
m_javaGlue->m_jsConfirm = GetJMethod(env, clazz, "jsConfirm", "(Ljava/lang/String;Ljava/lang/String;)Z");
@@ -3008,11 +3008,19 @@ void WebViewCore::openFileChooser(PassRefPtr<WebCore::FileChooser> chooser)
return;
WTF::String acceptType = chooser->acceptTypes();
+ WTF::String capture;
+
+#if ENABLE(MEDIA_CAPTURE)
+ capture = chooser->capture();
+#endif
+
jstring jAcceptType = wtfStringToJstring(env, acceptType, true);
+ jstring jCapture = wtfStringToJstring(env, capture, true);
jstring jName = (jstring) env->CallObjectMethod(
- javaObject.get(), m_javaGlue->m_openFileChooser, jAcceptType);
+ javaObject.get(), m_javaGlue->m_openFileChooser, jAcceptType, jCapture);
checkException(env);
env->DeleteLocalRef(jAcceptType);
+ env->DeleteLocalRef(jCapture);
WTF::String wtfString = jstringToWtfString(env, jName);
env->DeleteLocalRef(jName);