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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 1063383002: Use the existing user gesture token for PPAPI URL requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index b51c2a31d495a76c8aba4213d38ea7bfc1bc9133..2d94098d27f2b1643e1865f9d01e3785a8d69d8e 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -3161,7 +3161,8 @@ int32_t PepperPluginInstanceImpl::Navigate(
return PP_ERROR_FAILED;
}
web_request.setFirstPartyForCookies(document.firstPartyForCookies());
- web_request.setHasUserGesture(from_user_action);
+ if (IsProcessingUserGesture())
+ web_request.setHasUserGesture(true);
GURL gurl(web_request.url());
if (gurl.SchemeIs(url::kJavaScriptScheme)) {
@@ -3174,7 +3175,8 @@ int32_t PepperPluginInstanceImpl::Navigate(
// TODO(viettrungluu): NPAPI sends the result back to the plugin -- do we
// need that?
- WebString result = container_->executeScriptURL(gurl, from_user_action);
+ blink::WebScopedUserGesture user_gesture(CurrentUserGestureToken());
+ WebString result = container_->executeScriptURL(gurl, false);
Mike West 2015/04/08 07:36:39 Nit: Can we drop the second argument?
return result.isNull() ? PP_ERROR_FAILED : PP_OK;
}
@@ -3183,6 +3185,7 @@ int32_t PepperPluginInstanceImpl::Navigate(
return PP_ERROR_BADARGUMENT;
WebString target_str = WebString::fromUTF8(target);
+ blink::WebScopedUserGesture user_gesture(CurrentUserGestureToken());
container_->loadFrameRequest(web_request, target_str, false, NULL);
return PP_OK;
}
« 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