summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 18:12:35 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-10 18:12:35 +0000
commit9707e4d8acfdb2d7dd01cba2537cce931914b12f (patch)
tree246e79cbddf9eb6805e8187e9d3f7120344d3015 /webkit
parentf6952d37d66aa65cb1fb186bd3cf342c9f0ccba0 (diff)
downloadchromium_src-9707e4d8acfdb2d7dd01cba2537cce931914b12f.zip
chromium_src-9707e4d8acfdb2d7dd01cba2537cce931914b12f.tar.gz
chromium_src-9707e4d8acfdb2d7dd01cba2537cce931914b12f.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/10826250 git-svn-id: svn://svn.chromium.org/chrome/branches/1229/src@151088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc11
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.