diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-15 19:41:02 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-15 19:41:02 +0000 |
commit | 414af932048aca06014f3be923695808c504ef02 (patch) | |
tree | 617bcb978e0dd9981ddc43d7b7a9f54d6427deb4 | |
parent | ce0e6c1307f5ac9a20b9555b015c54d0af87d175 (diff) | |
download | chromium_src-414af932048aca06014f3be923695808c504ef02.zip chromium_src-414af932048aca06014f3be923695808c504ef02.tar.gz chromium_src-414af932048aca06014f3be923695808c504ef02.tar.bz2 |
Merge 150468 - Set the user gesture when executing script.
This is just like r145992 but for a different call site. If the script
executing creates a popup, we want the user gesture flag to be set correctly to
allow user-initiated popups.
BUG=130178
Review URL: https://chromiumcodereview.appspot.com/10827210
TBR=brettw@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10831335
git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@151729 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/plugins/ppapi/ppapi_plugin_instance.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc index a9f016b..5837df4 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -1824,8 +1824,15 @@ PP_Var PluginInstance::ExecuteScript(PP_Instance instance, } NPVariant result; - bool ok = WebBindings::evaluate(NULL, frame->windowObject(), &np_script, - &result); + bool ok = false; + if (IsProcessingUserGesture()) { + WebKit::WebScopedUserGesture user_gesture; + ok = WebBindings::evaluate(NULL, frame->windowObject(), &np_script, + &result); + } else { + ok = WebBindings::evaluate(NULL, frame->windowObject(), &np_script, + &result); + } if (!ok) { // TryCatch doesn't catch the exceptions properly. Since this is only for // a trusted API, just set to a general exception message. |