Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 10827210: Set the user gesture when executing script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 150390)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -1844,8 +1844,15 @@
}
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698