diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 00:33:32 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-08 00:33:32 +0000 |
commit | 7a801a64f1533207dcd591035c9ade1d8ddf144e (patch) | |
tree | 24dbd0a2209c0e08e618828cdbc187637aa771eb /webkit | |
parent | 5c9821ee35eb0fe126f254b891d34c8877a732b1 (diff) | |
download | chromium_src-7a801a64f1533207dcd591035c9ade1d8ddf144e.zip chromium_src-7a801a64f1533207dcd591035c9ade1d8ddf144e.tar.gz chromium_src-7a801a64f1533207dcd591035c9ade1d8ddf144e.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-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 f012793..f3616af 100644 --- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc +++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc @@ -1844,8 +1844,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. |