Commit 7a801a64 authored by brettw@chromium.org's avatar brettw@chromium.org

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
parent 5c9821ee
...@@ -1844,8 +1844,15 @@ PP_Var PluginInstance::ExecuteScript(PP_Instance instance, ...@@ -1844,8 +1844,15 @@ PP_Var PluginInstance::ExecuteScript(PP_Instance instance,
} }
NPVariant result; NPVariant result;
bool ok = WebBindings::evaluate(NULL, frame->windowObject(), &np_script, bool ok = false;
&result); 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) { if (!ok) {
// TryCatch doesn't catch the exceptions properly. Since this is only for // TryCatch doesn't catch the exceptions properly. Since this is only for
// a trusted API, just set to a general exception message. // a trusted API, just set to a general exception message.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment