summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-30 20:16:05 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-30 20:16:05 +0000
commitf08ea296bf058b47bba7f5afd756467318cefda9 (patch)
tree340abcaace818d3b928babffa5de666ce43db17a /webkit/plugins
parentc54787b16f8b88562a356caac10f3d8cee4cb1ce (diff)
downloadchromium_src-f08ea296bf058b47bba7f5afd756467318cefda9.zip
chromium_src-f08ea296bf058b47bba7f5afd756467318cefda9.tar.gz
chromium_src-f08ea296bf058b47bba7f5afd756467318cefda9.tar.bz2
Pepper/Flapper: Make PPB_Flash::Navigate() handle javascript: URLs.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6777026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/ppapi_plugin_instance.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 21465ba..66a38d9 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -1146,10 +1146,19 @@ int32_t PluginInstance::Navigate(PPB_URLRequestInfo_Impl* request,
web_request.setFirstPartyForCookies(document.firstPartyForCookies());
web_request.setHasUserGesture(from_user_action);
- if (GURL(web_request.url()).SchemeIs("javascript")) {
- // TODO(vtl)
- NOTIMPLEMENTED();
- return PP_ERROR_FAILED;
+ GURL gurl(web_request.url());
+ if (gurl.SchemeIs("javascript")) {
+ // In imitation of the NPAPI implementation, only |target_frame == frame| is
+ // allowed for security reasons.
+ WebFrame* target_frame =
+ frame->view()->findFrameByName(WebString::fromUTF8(target), frame);
+ if (target_frame != frame)
+ return PP_ERROR_NOACCESS;
+
+ // TODO(viettrungluu): NPAPI sends the result back to the plugin -- do we
+ // need that?
+ WebString result = container_->executeScriptURL(gurl, from_user_action);
+ return result.isNull() ? PP_ERROR_FAILED : PP_OK;
}
// Only GETs and POSTs are supported.