summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/jni/WebSettings.cpp
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2012-07-18 15:39:53 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2012-07-18 15:53:28 -0700
commitad46784d9075ff6d1e11cd2be47a6169761b0eeb (patch)
tree64006c7367e689eb4a4e66fe8500348b1fca1fa1 /Source/WebKit/android/jni/WebSettings.cpp
parentd12967fd535d36a592841c6c4bb112bd94092b3c (diff)
downloadexternal_webkit-ad46784d9075ff6d1e11cd2be47a6169761b0eeb.zip
external_webkit-ad46784d9075ff6d1e11cd2be47a6169761b0eeb.tar.gz
external_webkit-ad46784d9075ff6d1e11cd2be47a6169761b0eeb.tar.bz2
add webSetting API to allow media play without user gesture
bug:6806306 This also include partial change from webkit. http://trac.webkit.org/changeset/91232 Framework change: https://android-git.corp.google.com/g/#/c/208569/ Change-Id: I1a843472c0ce3b01bcad3b7c3c12c93702f2970c
Diffstat (limited to 'Source/WebKit/android/jni/WebSettings.cpp')
-rw-r--r--Source/WebKit/android/jni/WebSettings.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/WebKit/android/jni/WebSettings.cpp b/Source/WebKit/android/jni/WebSettings.cpp
index 467da3d..1bd3e36 100644
--- a/Source/WebKit/android/jni/WebSettings.cpp
+++ b/Source/WebKit/android/jni/WebSettings.cpp
@@ -151,6 +151,7 @@ struct FieldIds {
#endif
mOverrideCacheMode = env->GetFieldID(clazz, "mOverrideCacheMode", "I");
mPasswordEchoEnabled = env->GetFieldID(clazz, "mPasswordEchoEnabled", "Z");
+ mMediaPlaybackRequiresUserGesture = env->GetFieldID(clazz, "mMediaPlaybackRequiresUserGesture", "Z");
ALOG_ASSERT(mLayoutAlgorithm, "Could not find field mLayoutAlgorithm");
ALOG_ASSERT(mTextSize, "Could not find field mTextSize");
@@ -195,6 +196,7 @@ struct FieldIds {
ALOG_ASSERT(mUseDoubleTree, "Could not find field mUseDoubleTree");
ALOG_ASSERT(mPageCacheCapacity, "Could not find field mPageCacheCapacity");
ALOG_ASSERT(mPasswordEchoEnabled, "Could not find field mPasswordEchoEnabled");
+ ALOG_ASSERT(mMediaPlaybackRequiresUserGesture, "Could not find field mMediaPlaybackRequiresUserGesture");
jclass enumClass = env->FindClass("java/lang/Enum");
ALOG_ASSERT(enumClass, "Could not find Enum class!");
@@ -281,6 +283,7 @@ struct FieldIds {
#endif
jfieldID mOverrideCacheMode;
jfieldID mPasswordEchoEnabled;
+ jfieldID mMediaPlaybackRequiresUserGesture;
};
static struct FieldIds* gFieldIds;
@@ -616,6 +619,9 @@ public:
bool echoPassword = env->GetBooleanField(obj,
gFieldIds->mPasswordEchoEnabled);
s->setPasswordEchoEnabled(echoPassword);
+
+ flag = env->GetBooleanField(obj, gFieldIds->mMediaPlaybackRequiresUserGesture);
+ s->setMediaPlaybackRequiresUserGesture(flag);
}
};